Commit 84c17ecb by Jose Baez

Merge branch 'database' into 'develop'

Database

See merge request jbaez/ProyectoFinal-Bootcamp!3
parents 2fb0fb68 60e0e5e5
......@@ -4,6 +4,7 @@ target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/**
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
......
package com.roshka.proyectofinal;
import java.sql.Connection;
import java.sql.DriverManager;
public class DataBase {
public static Connection getConnection(){
Connection con=null;
try{
Class.forName("org.postgresql.Driver");
con= DriverManager
.getConnection("jdbc:postgresql://localhost:5432/Bootcamp_th",
"postgres", "postgres");
if(con != null){
System.out.println("---> CONNECTED TO SERVER");
}else {
System.out.println("---> UNABLE TO CONNECTED TO SERVER");
}
}catch(Exception e){
e.printStackTrace();
System.err.println(e.getClass().getName()+": "+e.getMessage());
System.exit(0);
}
return con;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment