• Post Reply Bookmark Topic Watch Topic
  • New Topic

is my idea possible?(about datasource in a J2EE server)

 
Guogang Fan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys !help me out
I want to set up a datasource but not bind it in a JNDI context.
I hope the datasource is only visible to my app.
I mean a datasource is ready to provide connection for my app,but not within JNDI.
how to do this ?
 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to implement your own javax.sql.DataSource and you don't need it to bind it to the JNDI if you don't want to.

Alternatively, you can use Spring The org.springframework.jdbc.datasource.DriverManagerDataSource in Spring implements javax.sql.DataSource.

 
Guogang Fan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Freddy Wong wrote:You need to implement your own javax.sql.DataSource and you don't need it to bind it to the JNDI if you don't want to.

Alternatively, you can use Spring The org.springframework.jdbc.datasource.DriverManagerDataSource in Spring implements javax.sql.DataSource.


thanks 4 your information ,but i still dont understand .
then how can I get a datasource Object?
within a JNDI context ,I can lookup ...If I do like you said ,in a web app, how will my datasource be managed in the servlet context ?

---sorry for my poor english
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!