procedure to create a connection pool in tomcat
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Leenu_Winner
Posted On:   Tuesday, September 26, 2006 07:56 AM

Could you please give me the correct procedure to create a connection pool in Tomcat I have logged into tomcat adminstrative tool and have given the following values Property Value JNDI Name: cms/cms Data Source URL: jdbc:mysql://localhost JDBC Driver Class: com.mysql.jdbc.Driver User Name: root Password: Max. Active Connections: 4 Max. Idle Connections: 2 Max. Wait for Connection: 5000 Validation Query: but could n't get the connection when i execute a jsp page like <%@ page import="java.sql.*, javax.naming.*, javax.sql.DataSource" %> <%!    More>>

Could you please give me the correct procedure to create a connection pool in Tomcat


I have logged into tomcat adminstrative tool and have given the following values

Property Value

JNDI Name: cms/cms

Data Source URL: jdbc:mysql://localhost

JDBC Driver Class: com.mysql.jdbc.Driver

User Name: root

Password:

Max. Active Connections: 4

Max. Idle Connections: 2

Max. Wait for Connection: 5000

Validation Query:


but could n't get the connection when i execute a jsp page like


<%@ page import="java.sql.*, javax.naming.*, javax.sql.DataSource" %>
<%!
DataSource ds=null;

Connection con=null;

%>
<%
try

{

Context initContext = new InitialContext();
ds=(DataSource)initContext.lookup("java:comp/env/cms/cms");

ds.getConnection();

out.println("connection established");

}

catch(Exception e)

{

e.printStackTrace();

}

%>




please help me.

   <<Less
About | Sitemap | Contact