• Post Reply Bookmark Topic Watch Topic
  • New Topic

CMP getConnetion  RSS feed

 
Nachiappan Narayanan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on a J2EE Project on the WebLogic 5.1 platform. I use the container managed persistence (CMP) and i want to connect each table in MySQL database to an entity bean.
In session beans i used to get the connection as follows:
getConnection("jdbc:mysql://localhost/BagCart, "nobody", "n0body843" )
Now in the case of CMP, how should mention the username and password, where should i specify it( Deployment descriptor or weblogic.properties) if so how to set it. Please any one help me.
Thanks in advance,
Regards,
Nachiappan.N
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've not used WebLogic 5.1 for a while (disclaimer!), but the username and password and usually associated with the datasource that you define within the weblogic console (or weblogic.properties). Then, in your CMP deployment descriptor, you just tell the app server which datasource should be used for the CMP bean.
Simon
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!