• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection pooling in jsp

 
jyothi nalam
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not able to connect to the database. following are the files that could help you help me,
server.xml

<Resource
name="jndi"
type="javax.sql.DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver"
password="tiger"
maxIdle="2"
maxWait="5000"
username="scott"
url="jdbcracle:thin:@localhost:1521rcl"
maxActive="4"/>

web.xml

<resource-ref>
<description>DB Connection Pooling</description>
<res-ref-name>jndi</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth> Container</res-auth>
</resource-ref>

my jsp file


<%@ taglib uri="/WEB-INF/sql.tld" prefix="sql" %>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>

<html>
<head>
<title>DB Test</title>
</head>


<body>

<h2>Results</h2>
<sql:query var="rs" dataSource="jndi">
select * from games
</sql:query>

<c:forEach var="row" items="${rs.rowsByIndex}">
<cut value="${row[0]}"/>
</c:forEach>

<input type="submit" value="delete"/><br>

</form></body></html>

My Error is
Cannot create JDBC driver of class '' for connect URL 'null'"
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jyothi t,
Welcome to JavaRanch!

We're pleased to have you here with us in the JSP forum, but there
are a few rules that need to be followed, and one is that proper names are
required. Please take a look at the
JavaRanch Naming Policy and
adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

You can use an initial for the first name but not the last.

You can change it here
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic