Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: ava.lang.ClassNotFoundException: jdbc:odbc:ABCODBC1

  1. #1
    Member
    Join Date
    Jul 2011
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy ava.lang.ClassNotFoundException: jdbc:odbc:ABCODBC1

    I'm trying to test out certain coding and I'm receiving the following error.

    Database - MsAccess.

    I've double check on the ODBC DataSource Administrator that I've set things correctly but yet been getting the error again and again. Hope someone advise me how to resolve the problem.

    Caused by: java.lang.ClassNotFoundException: jdbcdbc:ABCODBC1
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 07)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 52)
    at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:320)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.create DataSource(BasicDataSource.java:1130)

  2. #2
    Member
    Join Date
    Jul 2013
    Posts
    219
    Thanks
    0
    Thanked 18 Times in 17 Posts

    Default Re: ava.lang.ClassNotFoundException: jdbc:odbc:ABCODBC1

    Hello.
    When using JDBC, first we have to load the driver class.
    Then we have to get Connection object by passing url, username and password (if available).
    I believe when loading class you are not passing the driver class but the url.
    Check and let us know.

    Syed.

  3. #3
    Super Moderator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,104
    Thanks
    169
    Thanked 780 Times in 726 Posts
    Blog Entries
    5

    Default Re: ava.lang.ClassNotFoundException: jdbc:odbc:ABCODBC1


  4. #4
    Member
    Join Date
    Jul 2011
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: ava.lang.ClassNotFoundException: jdbc:odbc:ABCODBC1

    Quote Originally Posted by syedbhai View Post
    Hello.
    When using JDBC, first we have to load the driver class.
    Then we have to get Connection object by passing url, username and password (if available).
    I believe when loading class you are not passing the driver class but the url.
    Check and let us know.

    Syed.
    Hi Syed,

    Thank you so much for your reply.

    Am now reverting to my old code without the JNDI stuff anymore. And now facing another problem which I believe I have to post on a separate thread.

    Just want to clarify do you mean adding the line below when you said passing the driver class?

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = DriverManager.getConnection("jdbcdbc:ABCODBC1");


    Hope to hear from you soon.

    Tks again.

  5. #5
    Member
    Join Date
    Jul 2013
    Posts
    219
    Thanks
    0
    Thanked 18 Times in 17 Posts

    Default Re: ava.lang.ClassNotFoundException: jdbc:odbc:ABCODBC1

    Hi,
    In the second statement pass the db username and password as second and third parameters resp.
    If password is not available atleast provide just the username.
    Also, did you already create the DSN before running the program?

    Syed.

Similar Threads

  1. Replies: 2
    Last Post: July 2nd, 2013, 04:59 PM
  2. glassfish ClassNotFoundException java.lang.ClassNotFoundException: ...
    By enginco in forum JavaServer Pages: JSP & JSTL
    Replies: 2
    Last Post: June 18th, 2012, 12:18 PM
  3. Replies: 3
    Last Post: March 7th, 2012, 04:54 AM
  4. java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    By i4ba1 in forum JDBC & Databases
    Replies: 2
    Last Post: August 23rd, 2011, 12:41 PM
  5. Cannot locate sun.jdbc.odbc.jbcOdbc driver
    By birdlover2010 in forum JDBC & Databases
    Replies: 7
    Last Post: November 6th, 2010, 02:57 PM