jQuery in Action, 2nd edition*
The moose likes JDBC and the fly likes stange problem with MySql driver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "stange problem with MySql driver " Watch "stange problem with MySql driver " New topic
Author

stange problem with MySql driver

Raghav Mathur
Ranch Hand

Joined: Jan 12, 2001
Posts: 641
Hi
I recently installed a driver for connecting to MySql . The driver comprised of just one dll that is the odbc3.dll . i regestered that dll in my system but still could not connect . I then downloaded the corresponding jar file(mm.mysql-2.0.4-bin.jar.zip) and included in my class path ... it worked .
Now the thing is that i need to make an setup.exe for my application through which i also install the drivers dll in the users system . But since th dll didn't work , i probably have to install the jar file but for that i also need to edit the autoexec.bat file of the user . How do i do that ?
why didn't the dll work ???
PLease help me out
Thanks a ton in advance
[ May 08, 2003: Message edited by: raghav mathur ]

Raghav.
Raghav Mathur
Ranch Hand

Joined: Jan 12, 2001
Posts: 641
Any inputs ... please help .
Thanks
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Why do you need to edit the autoexec.bat file? Are you trying to adjust the system classpath setting?


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Raghav Mathur
Ranch Hand

Joined: Jan 12, 2001
Posts: 641
Originally posted by Dirk Schreckmann:
Why do you need to edit the autoexec.bat file? Are you trying to adjust the system classpath setting?

Yes i,am . What could be the other alternative ?
What i actually want to do and not bale to do is to connect to the databse from my application for which i need a driver . Now this application works fine when run from the console but when converted into a jar file , it fails to connect saying that the drivers are not installed .
Logically my setting the jar file in the class path did not help . I think you are right .... why do i need to edit my classpath.
How do i connect to the databse when my application is converted into a jar file . Do i need to bundle the drivers's jar file inside my own jar file ?
Please guide me a bit .
[ May 11, 2003: Message edited by: raghav mathur ]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Sounds like a classpath problem. Are you sure you specified the classpath in the JAR manifest correctly. Take a look at The Creating an Executable JAR File Thread (towards the bottom) for simple instructions.
Raghav Mathur
Ranch Hand

Joined: Jan 12, 2001
Posts: 641
Are you sure you specified the classpath in the JAR manifest correctly. [/QB]

No . I only mentioned the class file and the manifest version.
Do i need to include my own jar application in the manifest file too ?
Secondly if i do not want to set the classpath and want the drivers to be loaded with the load of my own jar application ?
Why am i asking this is because i might even need to provoke the JRE jar files from my own jar file .
what do you say ?
Raghav Mathur
Ranch Hand

Joined: Jan 12, 2001
Posts: 641
I have modified the manifest file and included the claspath also .
My manifest file looks like this :
Manifest-Version: 1.0
Main-Class: servunis
Classpath: server.jar
server.jar(my application) is in the same folder where the manifest file is kept and the jar file.
Still it didn't work .
[ May 12, 2003: Message edited by: raghav mathur ]
Raghav Mathur
Ranch Hand

Joined: Jan 12, 2001
Posts: 641
OK
I tried my application to connect with MS acces . Its did!
I made a jar file of this applpication and tried . It did !
I tried the same thing with MySql database( on another ip). It did !
I made a jar file of this application and tried. IT DID NOT WORK !!!
It works with access . The application works with MySql too but when converted into a jar file ... it just refuses to connect .
I,am in a fix
[ May 12, 2003: Message edited by: raghav mathur ]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Your manifest file is wrong. Take a better look at the aforementioned tutorial on creating executable JAR files.
Raghav Mathur
Ranch Hand

Joined: Jan 12, 2001
Posts: 641
Please tell me where did i go wrong ??
Now i've included the drivers jar file inside my own jar files manifest .
That's what the tutorial say
http://java.sun.com/docs/books/tutorial/ext/basics/download.html
[ May 12, 2003: Message edited by: raghav mathur ]
Raghav Mathur
Ranch Hand

Joined: Jan 12, 2001
Posts: 641
I tried this :
manifest file for test.jar:

I 've included the drivers path in the classpath variable and fired the following command:

Note :I've already created a test.jar
[ May 13, 2003: Message edited by: raghav mathur ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: stange problem with MySql driver