Subject | Firebird-JDBC connection troubleshooting |
---|---|
Author | overwreck |
Post date | 2004-01-08T11:27:15Z |
Hi,
I've been trying to connect to a test Firebird database I set up using
the exact same sample source code provided inthe JayBird zip using a
DataSource. THe database was created with my trusty copy of EMS
IBManager..with no data. I just wanted to test the connection.
The source code is like this:
FBWrappingDataSource dataSource = new FBWrappingDataSource();
OutputStreamWriter osw = new OutputStreamWriter(System.out);
PrintWriter pw = new PrintWriter(osw,true);
dataSource.setDatabase
("jdbc:firebirdsql://localhost/3050:D:/Javadev/Databases/MURATEST.GDB");
dataSource.setLogWriter(pw);
dataSource.setSqlRole("USER");
dataSource.setEncoding("NONE");
dataSource.setNonStandardProperty("isc_dpb_sweep", null);
dataSource.setNonStandardProperty("isc_dpb_num_buffers", "75");
try {
dataSource.setLoginTimeout (5);
System.out.println("trying to connect to " + dataSource.getDatabase());
Connection c = dataSource.getConnection ("sysdba", "masterkey");
System.out.println ("got connection");
c.close ();
}
catch (java.sql.SQLException e) {
System.out.println ("sql exception: " + e.getMessage ());
}
I wasnt able to get the "got connection" message, simply getting an
exception with the blocking timeout. I'm using Eclipse, Firebird 1.5
RC8. I've included the firebirdsql-full.jar in the libraries section
of Eclipse so I assume that's not the problem. I tried using the
printwriter to debug the problem but I am not too familiar with
programming JDBC stuff as this is my first time doing it..
Would appreciate it if someone can provide some pointers.
Many thanks.
Ethan
I've been trying to connect to a test Firebird database I set up using
the exact same sample source code provided inthe JayBird zip using a
DataSource. THe database was created with my trusty copy of EMS
IBManager..with no data. I just wanted to test the connection.
The source code is like this:
FBWrappingDataSource dataSource = new FBWrappingDataSource();
OutputStreamWriter osw = new OutputStreamWriter(System.out);
PrintWriter pw = new PrintWriter(osw,true);
dataSource.setDatabase
("jdbc:firebirdsql://localhost/3050:D:/Javadev/Databases/MURATEST.GDB");
dataSource.setLogWriter(pw);
dataSource.setSqlRole("USER");
dataSource.setEncoding("NONE");
dataSource.setNonStandardProperty("isc_dpb_sweep", null);
dataSource.setNonStandardProperty("isc_dpb_num_buffers", "75");
try {
dataSource.setLoginTimeout (5);
System.out.println("trying to connect to " + dataSource.getDatabase());
Connection c = dataSource.getConnection ("sysdba", "masterkey");
System.out.println ("got connection");
c.close ();
}
catch (java.sql.SQLException e) {
System.out.println ("sql exception: " + e.getMessage ());
}
I wasnt able to get the "got connection" message, simply getting an
exception with the blocking timeout. I'm using Eclipse, Firebird 1.5
RC8. I've included the firebirdsql-full.jar in the libraries section
of Eclipse so I assume that's not the problem. I tried using the
printwriter to debug the problem but I am not too familiar with
programming JDBC stuff as this is my first time doing it..
Would appreciate it if someone can provide some pointers.
Many thanks.
Ethan