File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes MySQL JDBC ConnectionPool Configuration in GrassFish v2.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "MySQL JDBC ConnectionPool Configuration in GrassFish v2.1" Watch "MySQL JDBC ConnectionPool Configuration in GrassFish v2.1" New topic
Author

MySQL JDBC ConnectionPool Configuration in GrassFish v2.1

Paul Okeke
Ranch Hand

Joined: May 16, 2009
Posts: 58
Am new in JEE, I being working with JavaDB but now I want to have MySQL experience.
I have downloaded and installed MySQL 5.1 and mysql-connector-java-5.1.6-bin.jar.

I set the path to the JDBC Driver in my environment Variable.
In GrassFish Application Server (Connection Pool) i made the following settings.

NAME: MySQLPool
DataSource ClassName: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
Resource Type: javax.sql.DataSource

Port: 3306
databaseName: xxxx
serverName: localhost
URL: jdbc:mysql://localhost:3306/xxxx
password: mypassword
user: root

Every other thing the remained its default value.


The problem is that when I Ping to confirm that the pool is ready for connection it shows an error message:
"Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlDataSource"


Please I will appriciate an assistance from any source......




OCJP 1.6
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874

Paul,
Place the mysql jar to the glassfish lib directory and try.
Paul Okeke
Ranch Hand

Joined: May 16, 2009
Posts: 58
I dont know now to Thanks you for kind and useful advice.
But all things being equal, I wish to say a BIG THANK YOU
for your simple advice because that has solved my problem

Once again THANK YOU!!! Balu Sadhasivam
Paul Okeke
Ranch Hand

Joined: May 16, 2009
Posts: 58
Please Balu Sadhasivam I really want to know the secret?
I remember that the last time I tried this with Oracle 10g XE
I eqaully encountered the same problem which forced me to
install the Enterprise Edition but the issue persited.
Hence, I removed Oracle and come to MySQL, it was the re-occurrance
of the same that force send this post.
I read the Sun GrassFish v2.1 Documentation & MySQL Connector-J Documentation
but have not come across this information.


I also have I mind to try out MicroSoft SQL.
Please, can you tell me the secret.

Dose it mean that for any Database I want to connect to using Type 4 driver
that I will Place the JDBC Driver for that Database in the lib folder of my App Server.
Please Tell..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MySQL JDBC ConnectionPool Configuration in GrassFish v2.1
 
Similar Threads
Glassfish SQLException: Error in allocating a connection in MySQL
How to specify the name of the database
MySQL & Sun App Server
EJB & JPA Unexpected Results
[JPA 2.0] Redoploying app deletes my database?