Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package DbLayer;
- import java.sql.Connection;
- import java.sql.DriverManager;
- /**
- * Created by Gabrielle on 04-04-16.
- */
- public class DbCon {
- Connection con;
- public DbCon(){
- try{
- Class.forName("org.postgresql.Driver");
- con = DriverManager.getConnection(
- "jdbc:postgresql://localhost:5432/Project3","project3", "project3");
- System.out.println("Verbinding succesvol: " + con.getSchema());
- }
- catch(Exception ex){
- System.out.println("Verbinding fout: " + ex.getMessage());
- }
- }
- public String[] readDiefstallen(){
- return new String[] {"Test data 1"," Test data 2"};
- }
- public void closeConnection(){
- try{
- con.close();
- }
- catch(Exception ex){
- System.out.println("Error: "+ex.getMessage());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement