• Post Reply Bookmark Topic Watch Topic
  • New Topic

Database and J2ee server help needed!  RSS feed

 
perry arora
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends!

Need your help.

How to we give information about the data base to the J2ee server, or i should say that how do we tell the information baout the Datasource which the j2ee server uses to communicate with the Database..
I want to confirm about what i have learned and what i have used so far.
In each and every server we have an .xml file for defining the data source , which in other words provides information to the j2ee server about the database!
I have used the OC4J( for e.g) the oracle container for java, in this we have an config file name data-source.xml , and in that we have few properties for the <datasource> tag to be defined, in those properties we have one property named,. "url" in which i have used the value as "jdbc racle:thin:@localhost:1521 aorcl" which i think serves a URL for the connecting to the data base..

I THINK I HAVE GOT RIGHT!.

and this is the only information which we provide to the Server about the databasE!>>
and regarding the connection Pooling that is being handled by the driver it seld what do we do implement that!
Please if any one coud help in what else we need to check about the data base which we are using except this. and What is Connection Pooling..
tnxs in advance!
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The configuration method is completely vendor specific. Yes, most vendors use an XML file but some might use a .properties file just as well.
I'd suggest you turn to one of our product forums for questions regarding the details.
 
perry arora
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Lasse Koskela:
The configuration method is completely vendor specific. Yes, most vendors use an XML file but some might use a .properties file just as well.
I'd suggest you turn to one of our product forums for questions regarding the details.
 
perry arora
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Lasse Koskela:
The configuration method is completely vendor specific. Yes, most vendors use an XML file but some might use a .properties file just as well.
I'd suggest you turn to one of our product forums for questions regarding the details.


thxs for clearing that
But plz tell me that do we have to write any code or .. we can staright way retirive a DataSource that is implementing the connection pooling behind the scenes , as i have checked in the Oracle9IAs, that have many different-2 implementation of the data sources ., and we have to lookup for the one which we needed... so all the Application servers have some method or we may have to write a code to implement that in our application
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, you don't need to code anything in order to configure the DataSource.
 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am doing the tutorial with Sun's RI for J2EE.I got my db connections working by configuring the jdbc Datasource with the Deployertool used for deploying my ejbs.
InitialContext ic = new InitialContext();
DataSource ds = (DataSource) ic.lookup("java:comp/env/jdbc/OrderDB");
Connection con = ds.getConnection();
jdbc/OrderDB JNDI name is mapped to a valid property in the resource.properties file containing the cloudscape driver that comes along
with the kit.Most of the App servers do provide Connection Pooling feature.It is easy to use and we do not have to write any code to implement it.
 
perry arora
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thxs a lot V. kumar
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!