• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DataSource and JNDI

 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Can I use the Datasource (ConnectionPoolDataSource) without JNDI?
 
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might find the following link helpful for you...
http://sales.esicom.com/sales/oracle/java.816/a81354/samapp9.htm
 
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know the answer to Pradeep's question. But if that is possible, can't we use the same approach in every place where we use JNDI?
-Sainudheen
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JNDI provides you the location transparency.
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Pradeep Bhat:
JNDI provides you the location transparency.


Like it is on your own machine? Just curious...
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ko Ko Naing:
You might find the following link helpful for you...
http://sales.esicom.com/sales/oracle/java.816/a81354/samapp9.htm


In the document Ko Ko posted a link to, there's this code sample:
What struck me in the eye was that this code doesn't specify where the database server is or which database to connect to. Is there some kind of default-to-localhost mechanism in Oracle's JDBC DataSource implementation?
PS. They do have another sample where the server name, port number and database name are explicitly set:
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

What struck me in the eye was that this code doesn't specify where the database server is or which database to connect to. Is there some kind of default-to-localhost mechanism in Oracle's JDBC DataSource implementation?



I dont think so.
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lasse Koskela, I think they accidently dropped out in the code... The server name, the database, the protocol and the port number are indispensible, if I am not wrong...
 
reply
    Bookmark Topic Watch Topic
  • New Topic