Hello,
I have setup a a small text file where user can specify the following, so that nothing is hard coded into the application:
Driver = com.mysql.jdbc.Driver
Driver String = jdbc:mysql://
Host = localhost
Port = 3306
user = root
pwd = root
I have some code to make the "Class.forName(driverClass).newInstance()"
Statement work.
I have driver (J Connector) added to my classpath or so I think. I do not wich o add it to my Jar or my Project as the user may wish to use a different Database eventually (like Oracle)
When I run the application through JBuilder it runs fine.
But when I run a JAR, i get "No Suitable Driver" error message.
I am using the following command
java -jar myjar.jar -cpmysql.jar
What am I doing wrong?
Thanks for you help!
Sherif
I have setup a a small text file where user can specify the following, so that nothing is hard coded into the application:
Driver = com.mysql.jdbc.Driver
Driver String = jdbc:mysql://
Host = localhost
Port = 3306
user = root
pwd = root
I have some code to make the "Class.forName(driverClass).newInstance()"
Statement work.
I have driver (J Connector) added to my classpath or so I think. I do not wich o add it to my Jar or my Project as the user may wish to use a different Database eventually (like Oracle)
When I run the application through JBuilder it runs fine.
But when I run a JAR, i get "No Suitable Driver" error message.
I am using the following command
java -jar myjar.jar -cpmysql.jar
What am I doing wrong?
Thanks for you help!
Sherif