SQLException - Not a suitable Driver - help to solve this prob!

Discussions

EJB programming & troubleshooting: SQLException - Not a suitable Driver - help to solve this prob!

  1. hi to all
    I want to know is that
    first of all i am using J2SDKEE 1.3 and
    and i had coded my CMP's , but the problem is that
    i am unable to connect to the database
    i exaclty code what i have done

    ////////////////// for getting connection i have done

    import javax.sql.DataSource
    private Connection getConnection()
        throws SQLException
      {
        InitialContext initCtx = null;
        try {
           initCtx = new InitialContext();
    DataSource ds= (javax.sql.DataSource) initCtx.lookup("java:comp/env/jdbc/TimeReportDB");
           return ds.getConnection();
         }
        catch(NamingException ne)
         {
           log("Failed to lookup JDBC Datasource. Please double check that");
           throw new EJBException(ne);
         }
        finally
         {
           try {
             if(initCtx != null) initCtx.close();
           }
           catch(NamingException ne)
           {
                   log("Error closing context: " + ne);
                   throw new EJBException(ne);
           }
         }
      }


     throught deplooyment tool setting
    i have set the following

    jdbcDataSource.name=jdbc/TimeReportDB
    jdbcDataSource.url=jdbc:odbc:TimeReportDB
    jdbcDriver.name=sun.jdbc.odbc.JdbcOdbcDriver

    "jdbc:odbc:TimeReportDB" is the DSN name &
    "jdbc/TimeReportDB" is the JNDI name

    the error which i am getting is
    SQLException -- Not a suitable Driver

    it will be quite helpful for me , is any one give solution/steps to configure my database in j2sdkee1.3

    cheers
    Deepak

  2. Deepak:

    Do u have correct drivers installed ? Do u have it in your class path of web/app server ?

    Deepak
  3. hi deepak ,

    thanxs for ur valueable suggestion !
    i think i have necessary drivers installed and i had included my class path too .
    i don't know what & where something going wrong
    i would be very help ful if u list down the steps
    for making a database connection .

    It would be a great help for me !
    cheers
    deepak