Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with JDBC connection with MySQL

 
aliasger talib
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I have a piece of code which runs with MySQL. I've done everything right (I think!), but if still says that I have a problem accessing my database. I've put the Jar file of my JDBC connector in the class path and on running the Java class I get the following error:
D:Code\classes>java com..jws.stockcore.StockCoreDOMGenerator
Exception in thread "main" java.lang.ClassNotFoundException: COM.cloudscape.core
.JDBCDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:130)
at com..jws.stockcore.StockCoreDOMGenerator.main(StockCoreDOMGenerat
or.java:114)
Any idea what's happening. I'm using SDK 1.4 and MySQL 1.4. Can anyone help me out on this one..
Thanks in advance.
- A.
 
John Dunn
slicker
Ranch Hand
Posts: 1108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following code works with mySQL 1.3.? You'll obviously have to put your SQL in instead of mine.
I don't know why you are getting CLOUDSCAPE errors???
You should have the mySQL connector in your classpath. Make sure you don't have any other jdbc stuff in your path as well.
 
aliasger talib
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know, i realised it a bit later. Feel pretty embarassed! :roll:
Thanks anyway. :-)
- A.
 
Marilyn de Queiroz
Sheriff
Posts: 9065
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aliz,

Why did you change your display name to one that violates the JavaRanch Naming Policy?

Please change it back, or at least to a name that conforms. Thank you.
 
aliasger talib
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sherrif! :-)
Sorry about that. Didn't know the rules. Changed it back.
- A.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic