1 Reply Latest reply: Mar 20, 2012 12:32 PM by user645055 RSS

    Need help: JDBC: SQLException: No suitable driver

    924905
      Hi,

      I tried to use JDBC with Berkeley DB. I instaledl Berkeley DB 5.3.15 with db-5.3.15.msi on windows xp.
      I followed "Building the SQL API" to download JDBC Sample Code and modify it. Modified code shown here
      public class CreateCoffees {
      
           public static void main(String args[]) {
                  
                String url = "jdbc:sqlite:myDataSource";
                Connection con;
                String createString;
                createString = "create table COFFEES " +
                                         "(COF_NAME varchar(32), " +
                                         "SUP_ID int, " +
                                         "PRICE float, " +
                                         "SALES int, " +
                                         "TOTAL int)";
                Statement stmt;
           
                try {
                     Class.forName("SQLite.JDBCDriver");
      
                } catch(java.lang.ClassNotFoundException e) {
                     System.err.print("ClassNotFoundException: "); 
                     System.err.println(e.getMessage());
                }
      
                try {
                     con = DriverManager.getConnection(url, 
                                                    "myLogin", "myPassword");
           
                     stmt = con.createStatement();                                   
                            stmt.executeUpdate(createString);
           
                     stmt.close();
                     con.close();
           
                } catch(SQLException ex) {
                     System.err.println("SQLException: " + ex.getMessage());
                }
           }
      }
      When I run this program under eclipse I get "SQLException: No suitable driver". I include jdbc.jar in the library also include "C:\Program Files\Oracle\Berkeley DB 11gR2 5.3.15\bin" as native library location. Any suggestion how to fix this issue?

      Thanks!
        • 1. Re: Need help: JDBC: SQLException: No suitable driver
          user645055
          I do not find the solution yet.
          But library dependency is a issue. libdb53.dll requires MSVCR80.dll and MSVCP80.dll.

          Does anyone get Berkeley DB JDBC work on windows?


          --------------------------------------------------------------------------------------

          L:\Berkeley DB 11gR2 5.3.15\bin>dumpbin /dependents libdb_sql53.dll
          Microsoft (R) COFF/PE Dumper Version 8.00.50727.762
          Copyright (C) Microsoft Corporation. All rights reserved.


          Dump of file libdb_sql53.dll

          File Type: DLL

          Image has the following dependencies:

          libdb53.dll
          KERNEL32.dll
          MSVCR80.dll

          Summary

          2000 .data
          C000 .rdata
          3000 .reloc
          1000 .rsrc
          54000 .text

          L:\Berkeley DB 11gR2 5.3.15\bin>dumpbin /dependents libdb53.dll
          Microsoft (R) COFF/PE Dumper Version 8.00.50727.762
          Copyright (C) Microsoft Corporation. All rights reserved.


          Dump of file libdb53.dll

          File Type: DLL

          Image has the following dependencies:

          WS2_32.dll
          KERNEL32.dll
          ADVAPI32.dll
          MSVCR80.dll
          MSVCP80.dll

          Summary

          1000 .data
          2E000 .rdata
          6000 .reloc
          1000 .rsrc
          105000 .text