File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection Pool

 
Malli Raman
Ranch Hand
Posts: 312
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a created a Connection Pool Object in Weblogic5.1(say oraclePool for Oracle database).

The question is
1. How to access the connection pool object in the Java Servlet Program. Is it thro' Jndi Look up.In that case how to map the JNDI Name with the oraclePool(i.e. what will be the jndi name for the oraclePool, i have created in the weblogic server).
2. This Question is about the security of the database. If user knows the connection pool name , then he can get the full access control to the database. Then in that case how to secure the connection pool object. Whether we have to store the connection pool (jndi name?) in the properties file (new file to be created in the weblogic server).
Please help me.
Regards,
Raman
 
Vishy Janardhan
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. How to access the connection pool object in the Java Servlet Program. Is it thro' Jndi Look up.In that case how to map the JNDI Name with the oraclePool(i.e. what will be the jndi name for the oraclePool, i have created in the weblogic server).
---> Create a DataSource in Weblogic for your connection pool (Use the weblogic console for that). For doing a JNDI lookup and getting a connection...u can use the following lines..
Context ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("MyOracleDataSource");
connection = ds.getConnection();
(declare and initialize connection object in your program...)
2. This Question is about the security of the database. If user knows the connection pool name , then he can get the full access control to the database. Then in that case how to secure the connection pool object. Whether we have to store the connection pool (jndi name?) in the properties file (new file to be created in the weblogic server).
---> since you are using wl 5.1 u can authenticate by using some username/password stored in a property file in your weblogic server.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic