Topic
  • 7 replies
  • Latest Post - ‏2008-01-03T11:23:23Z by SystemAdmin
SystemAdmin
SystemAdmin
1479 Posts

Pinned topic No suitable driver found error

‏2006-03-29T03:01:30Z |
Hi,

I am trying to connect to MS Access database from my code. I am using Websphere 5.1.
my code snippet is as follows :

Class.forName("sun.jdbc.odbc.Jdbcodbcdriver");
Connection conn = DriverManager.getConnection("jdbc:odbc:InvDSN");

I have also defined InvDSN in my System DSN.

However, I am getting the exception :

java.sql.SQLException: No suitable driver

What causes this error ? Do I need to add any jars into my classpath ?
Updated on 2008-01-03T11:23:23Z at 2008-01-03T11:23:23Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    1479 Posts

    Re: No suitable driver found error

    ‏2006-03-29T04:11:27Z  
    radhika.jithendar@gmail.com wrote:

    > Class.forName("sun.jdbc.odbc.Jdbcodbcdriver");

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  • SystemAdmin
    SystemAdmin
    1479 Posts

    Re: No suitable driver found error

    ‏2006-03-29T05:38:55Z  
    radhika.jithendar@gmail.com wrote:

    > Class.forName("sun.jdbc.odbc.Jdbcodbcdriver");

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Hi,

    It was a typing error here. In the code, I gave it as
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

    Still the error persists.
    Any help in this regard is welcome.

    > radhika.jithendar@gmail.com wrote:
    >
    > > Class.forName("sun.jdbc.odbc.Jdbcodbcdriver");
    >
    > Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  • SystemAdmin
    SystemAdmin
    1479 Posts

    Re: No suitable driver found error

    ‏2006-03-29T05:56:48Z  
    Hi,

    It was a typing error here. In the code, I gave it as
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

    Still the error persists.
    Any help in this regard is welcome.

    > radhika.jithendar@gmail.com wrote:
    >
    > > Class.forName("sun.jdbc.odbc.Jdbcodbcdriver");
    >
    > Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    radhika.jithendar@gmail.com wrote:
    > Hi,
    >
    > It was a typing error here. In the code, I gave it as
    > Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    >
    > Still the error persists.
    > Any help in this regard is welcome.

    Is the jar containing that driver on the classpath?
  • SystemAdmin
    SystemAdmin
    1479 Posts

    Re: No suitable driver found error

    ‏2006-03-30T03:45:23Z  
    radhika.jithendar@gmail.com wrote:
    > Hi,
    >
    > It was a typing error here. In the code, I gave it as
    > Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    >
    > Still the error persists.
    > Any help in this regard is welcome.

    Is the jar containing that driver on the classpath?
    Hi,

    I have put rt.jar into the classpath. Do I require any other jars?
    Do we have separate jar for MSAccess drivers ?
    I also heard that MS ACcess might not be compatible with WSAD. is it true?

    Regards,
    Radhika

    radhika.jithendar@gmail.com wrote:
    > > Hi,
    > >
    > > It was a typing error here. In the code, I gave it
    > as
    > > Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    > >
    > > Still the error persists.
    > > Any help in this regard is welcome.
    >
    > Is the jar containing that driver on the classpath?
  • SystemAdmin
    SystemAdmin
    1479 Posts

    Re: No suitable driver found error

    ‏2006-03-30T05:22:50Z  
    Hi,

    I have put rt.jar into the classpath. Do I require any other jars?
    Do we have separate jar for MSAccess drivers ?
    I also heard that MS ACcess might not be compatible with WSAD. is it true?

    Regards,
    Radhika

    radhika.jithendar@gmail.com wrote:
    > > Hi,
    > >
    > > It was a typing error here. In the code, I gave it
    > as
    > > Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    > >
    > > Still the error persists.
    > > Any help in this regard is welcome.
    >
    > Is the jar containing that driver on the classpath?
    radhika.jithendar@gmail.com wrote:
    > I have put rt.jar into the classpath. Do I require any other jars?
    Yes, that class is in the rt.jar in the base_v5_stub tree of RAD6. I
    don't have a WSAD version on this PC.

    > Do we have separate jar for MSAccess drivers ?
    No, the JDBC/ODBC bridge driver should use the existing ODBC driver
    DLLs. I don't recall ever playing with it, though. Sun considers it an
    R&D toy.

    > I also heard that MS ACcess might not be compatible with WSAD. is it true?
    Well the whole JDBC/ODBC bridge is not something Sun recommends using at
    all. Why not move the database into a real server? There are free
    versions of the "big 3" databases available from the vendors and DB2
    Express C has no particular functional restrictions on it.
  • SystemAdmin
    SystemAdmin
    1479 Posts

    Re: No suitable driver found error

    ‏2007-03-15T05:01:50Z  
    radhika.jithendar@gmail.com wrote:
    > I have put rt.jar into the classpath. Do I require any other jars?
    Yes, that class is in the rt.jar in the base_v5_stub tree of RAD6. I
    don't have a WSAD version on this PC.

    > Do we have separate jar for MSAccess drivers ?
    No, the JDBC/ODBC bridge driver should use the existing ODBC driver
    DLLs. I don't recall ever playing with it, though. Sun considers it an
    R&D toy.

    > I also heard that MS ACcess might not be compatible with WSAD. is it true?
    Well the whole JDBC/ODBC bridge is not something Sun recommends using at
    all. Why not move the database into a real server? There are free
    versions of the "big 3" databases available from the vendors and DB2
    Express C has no particular functional restrictions on it.
    Hi,

    I am trying to connect to MS Access DB through a jsp, but i get following error
    "java.sql.SQLException: No suitable driver "
    JSP Code

    <%
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String dataSourceName = "mdbTEST";
    String dbURL = "jdbc:odbc:" + dataSourceName;
    java.sql.Connection connection = java.sql.DriverManager.getConnection(dbURL);
    %>
    but when i write a stand alone java application with the same code and run it, it works fine
    Stand Alone Java application code

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String dataSourceName = "mdbTEST";
    String dbURL = "jdbc:odbc:" + dataSourceName;
    Connection con = DriverManager.getConnection(dbURL);
    Environment: WSAD 5.1, websphere test server 5.1

    I have put rt.jar in server's classpath by double clicking server->environment

    Is MS Access compatible with WSAD 5.1?
    Does JRE version come into picture?

    Can someone pls tell , where I am going wrong
  • SystemAdmin
    SystemAdmin
    1479 Posts

    Re: No suitable driver found error

    ‏2008-01-03T11:23:23Z  
    Hi,

    It was a typing error here. In the code, I gave it as
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

    Still the error persists.
    Any help in this regard is welcome.

    > radhika.jithendar@gmail.com wrote:
    >
    > > Class.forName("sun.jdbc.odbc.Jdbcodbcdriver");
    >
    > Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Hi,

    I am using WSAD 5.1,and trying to connect my jsp with Oracle.I am using JdbcOdbc Driver(Type-1).When i run my program it's giving me No class Found Error.So if I include rt.jar in the classpath its showing NO Suitable Server.Can anyone give the proper guidance and solution for my proble.Please help me its urgent.