Hi himanshu1979,
Here iam giving you two alternative solution for connection pooling while using jsp
Here you can do this way:
1)
weblogic.allow.execute.weblogic.servlet.classes=everyone
#
# Servlet reload properties
# weblogic.httpd.servlet.classpath=/freetaxprep/classes
weblogic.httpd.servlet.reloadCheckSecs=-1
#
# File servlet registration
weblogic.httpd.register.file=weblogic.servlet.FileServlet
weblogic.httpd.initArgs.file=defaultFilename=index.html
#
# ServerSideInclude servlet registration
weblogic.httpd.register.*.shtml=weblogic.servlet.ServerSideIncludeServlet
#
# Default servlet registration
weblogic.httpd.defaultServlet=file
#
weblogic.system.listenPort=1080
weblogic.security.ssl.enable=false
#weblogic.system.SSLListenPort=6643
weblogic.httpd.documentRoot=/freetaxprep/products/
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# WEBLOGIC JSP PROPERTIES
weblogic.httpd.register.*.jsp=\
weblogic.servlet.JSPServlet
weblogic.httpd.initArgs.*.jsp=\
pageCheckSeconds=1,\
compileCommand=/opt/Solaris_JDK_1.2.2_05a/bin/javac,\
workingDir=/weblogic/ftp/compiled_jsp,\
verbose=true,\
keepgenerated=true
#
weblogic.jdbc.connectionPool.oraclePool=\
url=jdbc:weblogic:oracle,\
driver=weblogic.jdbc.oci.Driver,\
loginDelaySecs=0,\
initialCapacity=10,\
maxCapacity=100,\
capacityIncrement=5,\
allowShrinking=true,\
shrinkPeriodMins=10,\
refreshMinutes=10,\
props=user=TAX2000;password=xxxxxxxx;server=TAX
# Set up ACLs for this connection pool with the following:
weblogic.allow.reserve.weblogic.jdbc.connectionPool.oraclePool=everyone
weblogic.allow.reset.weblogic.jdbc.connectionPool.oraclePool=everyone
weblogic.allow.shrink.weblogic.jdbc.connectionPool.oraclePool=everyone
2)While using the DBConnectionBroker, it will work
http://www.javaexchange.com
I hope this will help you out.
Regards,
Tirumalarao
Developer TechnicalSupport,
Sun MicroSystem,India.
1) If you are using SQLServer you have to install a driver(type IV) is available from weblogic itself. Give the .jar files of driver in weblogic classpath. Or you can use jdbc:odbc bridge itself.
2) In the weblogic properties file, create a connection pool. Something like this
weblogic.jdbc.connectionPool.SQLPool=\
url=jdbc:weblogic:mssqlserver4:myDB@server-name:1433,\
driver=weblogic.jdbc.mssqlserver4.Driver,\
loginDelaySecs=1,\
initialCapacity=1,\
maxCapacity=2,\
capacityIncrement=1,props=user=xxx;password=yyy
weblogic.allow.reserve.weblogic.jdbc.connectionPool.SQLPool=everyone
weblogic.allow.reset.weblogic.jdbc.connectionPool.SQLPool=everyone
weblogic.allow.shrink.weblogic.jdbc.connectionPool.SQLPool=everyone
for oracle the you have to do differently, and it is available in weblogic document with nice example.Again if you are using oracle, driver is coming along with the weblogic.
3)In your code, where you need connection, there are two ways...Use this one...
Driver myDriver = (Driver) Class.forName("weblogic.jdbc.pool.Driver").newInstance();
con = myDriver.connect("jdbc:weblogic:pool:SQLPool", null);
Hope this works..Cheers !