您的位置:首页 >> 编程开发 >> Java >> 数据库 >> 正文
RSS
 

HowdoyouconfigurejConnectJDBCConnectionPooling

http://www.rdxx.com 02年03月29日 11:18 互联网 我要投稿

关键词: JDBC , jConnect , UC , connection , OO , NEC , DBCC

Problem Description:
How do you configure jConnect JDBC Connection Pooling
with Apache Tomcat 4.1.x?

Tip or Workaround:
(Observations performed with jConnect-5_2
and Tomcat 4.1.18)

In line, below, are the text of what should be
saved as 3 files:

web.xml
sybase.jsp
server.xml.SybaseDelta


Please proceed as follows:

1) Create the following folders:
1.1) C:\Program Files\Apache Group\Tomcat 4.1\webapps\sybase
1.2) C:\Program Files\Apache Group\Tomcat 4.1\webapps\sybase\jsp
1.3) C:\Program Files\Apache Group\Tomcat 4.1\webapps\sybase\WEB-INF
1.4) C:\Program Files\Apache Group\Tomcat 4.1\webapps\sybase\WEB-INF\jsp


2) Move the file "web.xml" to folder
C:\Program Files\Apache Group\Tomcat 4.1\webapps\sybase\WEB-INF


3) Move the file "sybase.jsp" to folder
C:\Program Files\Apache Group\Tomcat 4.1\webapps\sybase\jsp


4) Copy the contents of file "server.xml.SybaseDelta" into your
existing "C:\Program Files\Apache Group\Tomcat 4.1\conf\server.xml"
file.

Insert the new content as an additional context within the
"Tomcat-Standalone" service specification. Insert this after
the last "</context>" entry, but before the "</host>" terminator
in the "Tomcat-Standalone" service grouping.

Replace the following strings with values appropriate
to your installation:

database_hostname
your_dbname
your_userid
your_password

If your dataserver is not "listening" on port 5000,
make the corresponding change for the port, too, in the
connection url.


5) Copy your jConnect\classes\jconn2.jar file into directory
C:\Program Files\Apache Group\Tomcat 4.1\common\lib


6) Shutdown and restart Tomcat.


7) From your web browser, enter the following url:

http://localhost:8080/Sybase


-----------------------------------------------------------

 

Text of file "web.xml"
----------------------

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

<welcome-file-list>
<welcome-file> /jsp/sybase.jsp </welcome-file>
</welcome-file-list>

<!-- for using dscp -->

<resource-ref>
<res-ref-name> jdbc/a_sybase_datasource </res-ref-name>
<res-type> javax.sql.DataSource </res-type>
<res-auth> Container </res-auth>
</resource-ref>


</web-app>

END_OF_TEXT(web.xml)


Text of file "sybase.jsp"
-------------------------

<%@ page import="java.sql.*" %>
<%@ page import="javax.sql.*" %>
<%@ page import="javax.naming.*" %>
<%@ page import="java.util.*" %>

<html>
<head> <title> Testing Sybase DataSource </title> </head>

<body bgcolor="white">
<font size=4>

<h3> Start of Test </h3>

<%

String s = "java:comp/env";
String t = "jdbc/a_sybase_datasource";

InitialContext initCtx = null;
try

共3页  1 2 3

 
 
标签: JDBC , jConnect , UC , connection , OO , NEC , DBCC 打印本文
 
 
  热点搜索
 
 
 



Valid XHTML 1.0 Transitional
Copyright ©2005 - 2008 Rdxx.Com,All Rights Reserved
收藏本页
收藏本站