SunQuest
 
           MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old January 10th, 2003, 03:28 PM
mike@prudential mike@prudential is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 4 mike@prudential User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation help configuring MySql and JDBC Drivers

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.

Reply With Quote
  #2  
Old January 12th, 2003, 02:02 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
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

Reply With Quote
  #3  
Old January 13th, 2003, 09:39 AM
mike@prudential mike@prudential is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 4 mike@prudential User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I have downloaded it, but not sure how to install it properly.

Reply With Quote
  #4  
Old January 13th, 2003, 03:28 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
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:
USAGE AND INSTALLATION

MySQL Connector/J is distributed as a .jar archive containing the sources
and class files as well as a class-file only "binary" .jar archive
named "mysql-connector-j-2.0.13-bin.jar".

You will need to use the "jar" command-line utility that comes with your JDK
to un-archive the distribution.

Once you have un-archived the distribution .jar archive,
you can install the driver in one of two ways:

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):


Hope that helps... If you need any assistance, let me know.

Reply With Quote
  #5  
Old January 14th, 2003, 12:35 PM
mike@prudential mike@prudential is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 4 mike@prudential User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #6  
Old January 14th, 2003, 08:36 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
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.

Reply With Quote
  #7  
Old January 15th, 2003, 09:15 AM
mike@prudential mike@prudential is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 4 mike@prudential User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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!

Reply With Quote
  #8  
Old January 18th, 2003, 04:43 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
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?

Reply With Quote
  #9  
Old June 4th, 2004, 05:08 AM
khalass khalass is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 1 khalass User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > help configuring MySql and JDBC Drivers


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway