Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.sql.*;
- import java.util.*;
- public class FireBirdConnection {
- public Connection con = null;
- public Statement stmt;
- public ResultSet rs;
- public FireBirdConnection() {
- String driver = null;
- String url = null;
- String login = null;
- String pass = null;
- Parameters params = null;
- try {
- params = new Parameters();
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- }
- try {
- url = params.getDataBaseHost();
- login = params.getDataBaseUser();
- pass = params.getDataBasePassword();
- driver = params.getDataBaseDriver();
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- try {
- Class.forName(driver).newInstance();
- con = DriverManager.getConnection(url, login, pass);
- } catch (ClassNotFoundException ex) {
- System.err.println("FireBirdConnection.Cannot find this DB driver classes.");
- ex.printStackTrace();
- } catch (SQLException e) {
- System.err.println("FireBirdConnection.Cannot connect to this DB.");
- e.printStackTrace();
- } catch (InstantiationException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- }
- }
- }
- DBDRIVER=org.firebirdsql.jdbc.FBDriver
- ADMINPASSWORD=0095
- DBUSER=SYSDBA
- DBPASS=masterkey
- DBHOST=jdbc:firebirdsql:local:D:\ExamDB\EXAM.FDB?encoding=utf8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement