Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

when executing the IsqlApp class I'm having a ClassNotFoundException. According to me the file should not be looking for that driver but the one in the jconn4.jar (I installed Jconnect7)

How can I solve this problem?

Unexpected exception : java.lang.ClassNotFoundException: com.sybase.jdbc.SybDriv
er
java.lang.ClassNotFoundException: com.sybase.jdbc.SybDriver
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at IsqlApp.doIsql(IsqlApp.java:86)
        at IsqlApp.main(IsqlApp.java:58)

asked 17 Jul '12, 05:39

michaelvanwyngaerden's gravatar image

michaelvanwy...
46224
accept rate: 0%

edited 17 Jul '12, 08:09

Breck%20Carter's gravatar image

Breck Carter
32.5k5417261050


You have the wrong classname being loaded by your JDBC code for jConnect 7.0.

See: http://dcx.sybase.com/index.html#1201/en/dbprogramming/jconnect-using-jdbxextra.html


The jConnect JDBC driver

The classes in jConnect are all in com.sybase.jdbc4.jdbc. You must import these classes at the beginning of each source file:

import com.sybase.jdbc4.jdbc.*

Loading the jConnect driver

Ensure that the jConnect driver is in your class file path. The driver file jconn4.jar is located in the classes subdirectory of your jConnect installation.

set classpath=.;c:\jConnect-7_0\classes\jconn4.jar;%classpath%

The jConnect driver takes advantage of the new automatic JDBC driver registration. The driver is automatically loaded at execution startup when it is in the class file path.


If you are using JDBC 4.0, you should note that you no longer are required to call DriverManager.registerDriver() and this is taken care of for you instead.

permanent link

answered 18 Jul '12, 15:13

Jeff%20Albion's gravatar image

Jeff Albion
10.8k171175
accept rate: 25%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×39

question asked: 17 Jul '12, 05:39

question was seen: 3,527 times

last updated: 18 Jul '12, 15:13