Advertisement
Guest User

Untitled

a guest
May 26th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. <Resource name="jdbc/myoracle" auth="Container"
  2. type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver"
  3. url="jdbc:oracle:thin:@INNOA6PC03070SZ.ptt.cti.com:1521:XE"
  4. username="loginname" password="password" maxActive="20" maxIdle="10"
  5. maxWait="-1"/>
  6.  
  7. Context initContext = new InitialContext();
  8. Context envContext = (Context) initContext.lookup("java:/comp/env");
  9. DataSource ds = (DataSource) envContext.lookup("jdbc/myoracle");
  10. conn = ds.getConnection();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement