|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
I am new to mysql and jsp. I am trying to connect a mysql database to a webpage using jsp and jdbc. Can anybody please help me configure the JDBC Driver? I use tomcat as my local web server.
|
|
#2
|
|||
|
|||
|
Mike,
Have you downloaded the appropriate drivers needed to configure your server? If not, check out the MySQL site: http://www.mysql.com/products/connector-j/index.html
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
|
#3
|
|||
|
|||
|
I have downloaded it, but not sure how to install it properly.
|
|
#4
|
|||
|
|||
|
Mike,
Did you download the Connector/J driver I mentioned, or do you have a different driver? To install the driver, you'll need to follow the instructions that come with the file (README)... Here's the excerpt: Quote:
Hope that helps... If you need any assistance, let me know. |
|
#5
|
|||
|
|||
|
I un-archived the jar file by typing
"c:\jar -xf mysql-connector-java-2.0.14-bin.jar" which is the name of the jar file to be un-archived. It doesn't appear that the jar command did anything. Now I am at the part that says" Either copy the "com" and "org" subdirectories and all of their contents to anywhere you like, and put the directory holding the "com" and "org" subdirectories in your classpath, or... Put mysql-connector-j-2.0.14-bin.jar in your classpath, either by adding the FULL path to it to your CLASSPATH enviornment variable, or putting it in $JAVA_HOME/jre/lib/ext. If you are using a servlet engine or application server, you will have to read your vendor's documentation for more information on how to configure third-party class libraries, as most application servers ignore the CLASSPATH environment variable. If you are developing servlets and/or JSPs, and your application server is J2EE-compliant, you should put the driver's .jar file in the WEB-INF/lib subdirectory of your webapp, as this is the standard location for third party class libraries in J2EE web applications. You can also use the MysqlDataSource, MysqlConnectionPoolDataSource or MysqlXADataSource classes in the com.mysql.jdbc.jdbc2.optional package, if your J2EE application server supports/requires them. MysqlDataSource supports the following parameters (through standard "set" mutators): I don't understand how to do the rest of the instructions because this is the first time I have ever done this stuff before. Thank You for all the Help |
|
#6
|
|||
|
|||
|
Okay, I've been reading through the driver's docs, as well as those for Tomcat, and I think I may have found the solution...
What you can do is place the .JAR file, mysql-connector-java-2.0.14-bin.jar into your $JAVA_HOME/jre/lib/ext directory... The $JAVA_HOME is defined under the environment variables in Windows (I'm assuming you're running either 2000 or XP). To get it working in Tomcat: You'll also need to put the .JAR file into your $CATALINA_HOME/common/lib directory. Again, the $CATALINA_HOME will be specified in the environment variables... It can be C:\TOMCAT or wherever else you've installed Tomcat. Hope that helps... Let me know how it goes. |
|
#7
|
|||
|
|||
|
I did exactly as you said, but I still get a class not found error. What do I need to do with the other files in the mysql-connector-java-2.0.14 folder. I think that might be the problem.
Thank You Again for all of your help! It is greatly appreciated! |
|
#8
|
|||
|
|||
|
Mike,
I'm curious to see the code you're using when trying it out... If possible, can you post the code here in the forum. Do you get this error for ALL your scripts? |
|
#9
|
|||
|
|||
|
Hi,
I got the same problem which I cannot seem to get working. I have downloaded Tomcat 5.0. I have also downloaded the MySQL Connector/J from URL website. In the documentation with the driver it states to place the mysql-connector-java-3.0.14-production-bin jar file in the WEB-INF/lib subdirectory of the webapp directory. Here are the instructions taken from the documentation, “If you are developing servlets and/or JSPs, and your application server is J2EE-compliant, you should put the driver's .jar file in the WEB-INF/lib subdirectory of your webapp, as this is the standard location for third party class libraries in J2EE web applications.” I have tried this and get error message from the Tomcat server. I think this is because these instructions relate to an older version of Tomcat. Could you tell me where do I need to place this jar file and also are there any other files in Tomcat that I need to modify inorder to get a connection to the MySQL database which is also on the same machine. I am using JSP’s as the developing language. I look forward to hearing from yourself, Regards, khalass. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > help configuring MySql and JDBC Drivers |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|