Subject | url-encoded paramter for firebirdsql does not work |
---|---|
Author | tsangccn |
Post date | 2002-08-07T08:44:24Z |
I have just download firebirdsql.jar and try with the following code
(1)
Class.forName("org.firebirdsql.jdbc.FBDriver");
java.util.Properties props = new java.util.Properties();
props.put("user", "sysdba");
props.put("password", "masterkey");
props.put("lc_ctype", "UNICODE_FSS");
Connection conn =
DriverManager.getConnection("jdbc:firebirdsql:host02/3050:/home/databases/sample.gdb",
props);
and works OK (I have to put firebirdsql.jar and j2ee.jar in my classpath).
(2) But when I try the following
Class.forName("org.firebirdsql.jdbc.FBDriver");
Connection conn =
DriverManager.getConnection("jdbc:firebirdsql:host02/3050:/home/databases/sample.gdb?lc_ctype=UNICODE_FSS&user=sysdba&password=masterkey");
Then, an exception is thrown as follows
Exception in thread "main" java.lang.NullPointerException
at java.lang.String.<init>(String.java:399)
at
org.firebirdsql.jca.FBConnectionRequestInfo.getStringProperty(FBConnectionRequestInfo.java:97)
at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:173)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:193)
at TestUnicode.main(TestUnicode.java:17)
(3) But when I try the following
Class.forName("org.firebirdsql.jdbc.FBDriver");
Connection conn =
DriverManager.getConnection("jdbc:firebirdsql:host02/3050:/home/databases/sample.gdb?lc_ctype=UNICODE_FSS",
"sysdba", "masterkey");
Then, an exception is thrown as follows
Exception in thread "main" java.sql.SQLException: Problem getting
connection: could not get a db connection!
at
org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:124)
at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:208)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at TestUnicode.main(TestUnicode.java:17)
But I need the URL-encoded form to work. Can anybody help? Am I need
to apply any patch?
Thanks
(1)
Class.forName("org.firebirdsql.jdbc.FBDriver");
java.util.Properties props = new java.util.Properties();
props.put("user", "sysdba");
props.put("password", "masterkey");
props.put("lc_ctype", "UNICODE_FSS");
Connection conn =
DriverManager.getConnection("jdbc:firebirdsql:host02/3050:/home/databases/sample.gdb",
props);
and works OK (I have to put firebirdsql.jar and j2ee.jar in my classpath).
(2) But when I try the following
Class.forName("org.firebirdsql.jdbc.FBDriver");
Connection conn =
DriverManager.getConnection("jdbc:firebirdsql:host02/3050:/home/databases/sample.gdb?lc_ctype=UNICODE_FSS&user=sysdba&password=masterkey");
Then, an exception is thrown as follows
Exception in thread "main" java.lang.NullPointerException
at java.lang.String.<init>(String.java:399)
at
org.firebirdsql.jca.FBConnectionRequestInfo.getStringProperty(FBConnectionRequestInfo.java:97)
at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:173)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:193)
at TestUnicode.main(TestUnicode.java:17)
(3) But when I try the following
Class.forName("org.firebirdsql.jdbc.FBDriver");
Connection conn =
DriverManager.getConnection("jdbc:firebirdsql:host02/3050:/home/databases/sample.gdb?lc_ctype=UNICODE_FSS",
"sysdba", "masterkey");
Then, an exception is thrown as follows
Exception in thread "main" java.sql.SQLException: Problem getting
connection: could not get a db connection!
at
org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:124)
at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:208)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at TestUnicode.main(TestUnicode.java:17)
But I need the URL-encoded form to work. Can anybody help? Am I need
to apply any patch?
Thanks