This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Trying to set up Connection Pooling using Glassfish

 
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm trying to set up connection pooling in my web app.
I'm pretty new in Glassfish and connection pooling so I apologize in advance if this is a newbie question.

Here are the steps I do:
1.) I follow example from this tutorial: http://blogs.sun.com/JagadishPrasath/entry/creating_jdbc_connection_pool_resource
Using "Admin Console"

- I create a JDBC Pool. I successfully ping it
JNDI Name: mysqlPool
Resource Type: javax.sql.DataSource
Datasource Classname: com.mysql.jdbc.jdbc2.optional.MysqlDataSource

- Create JDBC resource to associate with the connection pool
JNDI name: mysqlsource
Status: Enabled

2.) Then just for testing, I put this in a JSP:


3.) But I got this error message:
Couldn't open connection to database: No object bound to name java:comp/env/mysqlsource

I'm not sure what steps I'm missing. Can someone please advise?
Thanks in advance for all the help.
 
Susan Smith
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Just wondering if anyone has any suggestion.

Thank you in advance for all the help.
 
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Usually the DataSource is expected under the sub context jdbc.

Try changing the JNDI name as jdbc/mysqlsource


 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi



or
//in my case





This should work for you. Because jndiname you provided on admin console is global jndi name.


Glassfish Consulting service is available at http://www.jmatrix.in

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!