1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| int connectionAlternative = CONNECT_DRIVERMANAGER;
switch (connectionAlternative) {
case CONNECT_DRIVERMANAGER:
/* This alternative is driver independent; the DriverManager will find
* the right driver for you based on the jdbc subprotocol.
*/
try {
System.out.println("kljhljljl");
System.out.println(user);
Properties props = new Properties();
props.setProperty("user", "SYSDBA");
props.setProperty("password", "masterkey");
props.setProperty("port", "3050");
props.setProperty("dialect", "3");
props.setProperty("encoding", "UTF8");
props.setProperty("host", "w-iss");
props.setProperty("database", "SFE DATA\\BASES\\SANTE.FDB");
//props.setProperty("lc_ctype", "ISO8859_1");
//con = java.sql.DriverManager.getConnection(databaseURL, "", "");
con = java.sql.DriverManager.getConnection(databaseURL,props);
//con = java.sql.DriverManager.getConnection("jdbc:firebirdsql://w-iss", "dldk", "dmlk");
System.out.println("Connection established.");
} catch (java.sql.SQLException e) {
e.printStackTrace();
System.out.println("Unable to establish a connection through the driver manager.");
showSQLException(e);
return;
}
break; |
Partager