JDBC CLASSPATH Not Working

前端 未结 5 1563
遇见更好的自我
遇见更好的自我 2021-01-20 03:51

I\'m setting up a simple JDBC connection to my working MySQL database on my server. I\'m using the Connector-J provided by MySQL. According to their documentation, I\'m supp

5条回答
  •  面向向阳花
    2021-01-20 04:21

    I know this is an old thread but it might help someone.

    I have succeeded connecting to SQLite3 on Windows 7 with the proper CLASSPATH

    I use the JDBC driver sqlite-jdbc-3.7.2.

    First I tried to copy the driver under the directory c:\Program Files\java\jre7\lib and then set the CLASSPATH variable, but that failed to recognize the line :

    Class.forName("org.sqlite.JDBC");
    

    I think that's due to the Windows bug to have spaces in a folder name like "Program Files".

    So I copied the JAR file under C:\jbmorla and set the CLASSPATH to:

    .;c:\jbmorla\sqlite-jdbc-3.7.2.jar
    

    Hope this helps

提交回复
热议问题