dcsimg
Connecting to Oracle from EJB
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   swaminathan_natarajan
Posted On:   Thursday, August 16, 2001 04:57 AM

Hi All I am quite new to EJB Development. I use J2EE (J2SDKEE1.2.1 version.) Inorder to connect to my Oracle instance I use the following lines in default.properties jdbc.drivers=oracle.jdbc.driver.OracleDriver jdbc.datasources=jdbc/Oracle|jdbc:oracle:thin:@ : : Where jdbc/Oracle is my JNDI name. I would be using the following in my EJB code InitialContext ic = new InitialContext(); DataSource ds = (DataSource) ic.lookup(dbName); cn = ds.getConnection(); But I want to put the userid and password of Oracle in the default.properties file. What is the syntax for the same.? In order to centralise the userid/password I only want a solution which i can put in    More>>

Hi All

I am quite new to EJB Development. I use J2EE (J2SDKEE1.2.1 version.) Inorder to connect to my Oracle instance I use the following lines in default.properties

jdbc.drivers=oracle.jdbc.driver.OracleDriver

jdbc.datasources=jdbc/Oracle|jdbc:oracle:thin:@ : :

Where jdbc/Oracle is my JNDI name.

I would be using the following in my EJB code

InitialContext ic = new InitialContext();
DataSource ds = (DataSource) ic.lookup(dbName);
cn = ds.getConnection();

But I want to put the userid and password of Oracle in the default.properties file. What is the syntax for the same.? In order to centralise the userid/password I only want a solution which i can put in default.properties file. (Also I don't want to pass the userid and password to the getConnection method in my EJB)

   <<Less
About | Sitemap | Contact