Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Setting up MySQL dataSource in WSAD 5.1.1

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does anyone have experience/info on setting up a JDBC Datasource in WSAD for MySQL. I am trying to set up a datasource (with a JNDI name - ie: jdbc/cdcatalog) for a WAS 5.1 test server (just a basic server configuration) running inside WSAD 5.1.1. I am using the MySQL jarfile:
mysql-connector-java-3.0.9-stable-bin.jar. I have MySQL running OK on localhost:3306 (default). I am adding information to the Data source tab of the server configuration editor. In addition, I tried to add a resource reference to the web.xml:
<resource-ref id="ResourceRef_1083720835000">
<description>MySQL4 connection</description>
<res-ref-name>jdbc/cdcatalog</res-ref-name>
<res-type>java.lang.Object</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
However, when I run a test app that attempts to connect to the database, I get all manner of exceptions related to errors with the lookup and methods not found. A sample of just ONE of the exceptions is:
Unable to find constructor for DataStoreHelper: com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource. Perhaps I am using the wrong implementation class name...any help would be appreciated.
Thanks
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mark,
Welcome to JavaRanch, the absolute best site on the www for Java information. We don't have many rules around here, but we do have one. Please change your display name to a first and last name to comply with the JavaRanch Naming Policy. You can change it here. Thank you for your cooperation.
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here are two articles:
http://www.webspherepower.com/issues/issue200310/00001111001.html
http://www.webspherepower.com/issues/issue200403/00001236001.html
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, that articles are so god, but one question, I don't need to configure de server Data source?, i have the same problem and I don't know how do that! can someone help me?


PD: My English is so bad :roll:
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The second article describes configuring your data source. Is there something else you're looking for?

Kyle
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One thing you may want to remember, you cannot create EBJs using MySQL. At least that's what IBM support told me after I spent days trying....
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Robert Eanes for the links
just an observation: You can configure the datasource in WSAD Also, you can use the directives from the second article (like implementation, helper class names) to configure the datasource in WSAD without going to administrative console.

cheers
Sushil
 
Sheriff
Posts: 3036
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bob, I think you mean WebSphere doesn't generate the support classes for CMP Entity Beans for MySQL. There are a number of databases supported, but unfortunately not MySQL yet.

You can still use other types of EJBs though: Session Beans, Message Driven Beans, and BMP Entity Beans.
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have followed the steps provided in the first article
http://www.webspherepower.com/issues/issue200310/00001111001.html

but I get the following error: iwas0126e problems encountered while trying to establish connection reason java.util.linkedhashmap.

I am using wsad 5.1.2, mysql 4.1 and jdbc driver connectorJ 3.1

Ny help

Manhar.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Try using Connector/J 3.0 at http://www.mysql.com/downloads/api-jdbc-stable.html. I had the same problem, but it worked for me when I did this. Hope this helps.
-Asha
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
a question

is it works with PostgreSQL too?

thanks
 
The harder you work, the luckier you get. This tiny ad brings luck - just not good luck or bad luck.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic