Subject | Re: [Firebird-Java] JDK1.4.2.17 No suitable driver error. |
---|---|
Author | Mark Rotteveel |
Post date | 2009-08-24T17:26:42Z |
Your code runs fine on 1.4.2_19 using Jaybird 2.1.6_JDK1.4 (only thing I
changed is the databasepath and package + class name). It also gives the
expected result (WIN1252).
After a quick test it looks like it is caused by your usage of '!' in
your classpath. I tested this using a folder called D:\!Dev and D:\Dev
when using D:\!Dev it failed, using D:\Dev it worked.
You might want to consider removing the exclamation mark from you pathnames.
Retesting using Java 6 Update 15 shows both paths works. Most likely the
problem arises from the fact that the classloader uses JAR-urls, and I
seem to remember that these use an exclamation mark as separator between
the JAR and the file contained in the JAR.
I hope you do realize that Java 1.4.2 is End Of Life.
Mark
iananewby wrote:
Mark Rotteveel
changed is the databasepath and package + class name). It also gives the
expected result (WIN1252).
After a quick test it looks like it is caused by your usage of '!' in
your classpath. I tested this using a folder called D:\!Dev and D:\Dev
when using D:\!Dev it failed, using D:\Dev it worked.
You might want to consider removing the exclamation mark from you pathnames.
Retesting using Java 6 Update 15 shows both paths works. Most likely the
problem arises from the fact that the classloader uses JAR-urls, and I
seem to remember that these use an exclamation mark as separator between
the JAR and the file contained in the JAR.
I hope you do realize that Java 1.4.2 is End Of Life.
Mark
iananewby wrote:
> Hi Folks,--
> I've written the following small test class to test issues with character sets:
>
> package dbcharsettest;
>
> import java.sql.Connection;
> import java.sql.Driver;
> import java.sql.DriverManager;
> import java.util.Properties;
> import org.firebirdsql.jdbc.FBConnection;
>
> public class Main {
>
> public Main() {
> }
>
> public static void main(String[] args) {
>
> try {
> Driver driver = (Driver)Class.forName("org.firebirdsql.jdbc.FBDriver").newInstance();
> DriverManager.registerDriver(driver);
> Properties p = new Properties();
> p.setProperty("user","aktivate");
> p.setProperty("password","s1v2n3f9");
> p.setProperty("encoding","WIN1252");
> p.setProperty("sqlDialect","1");
> Connection con = DriverManager.getConnection("jdbc:firebirdsql://localhost/C:/!Development/Aktiv2/DataSafe/Aktiv.fdb", p);
> System.out.println(((FBConnection) con).getIscEncoding());
> con.close();
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> }
>
> when I run it, with the following command:
>
> C:\j2sdk1.4.2_17\jre\bin\java.exe -classpath C:\!Development\Libraries\FirebirdSQL\Jaybird-2.1.6JDK_1.4\jaybird-full-2.1.6.jar;C:\!Development\DBCharsetTest\build\classes dbcharsettest.Main
>
> I get a no suitable driver error. This program works fine if I use an older version (1.5) of the driver.
>
> Has something changed that I have missed?
>
> Regards
> Ian
Mark Rotteveel