Xml document for use with mysql database connection pool proxool
Abstract: xml document with mysql database connection pool proxool
</ Td> </ tr> <tr> <td height="35" valign="top" class="ArticleTeitle"> 1, to write xml documents: WEB Proxool.xml Add to your application's WEB-INF \ classes below, as follows: XmlFile WEB-INF/classes/Proxool.xml
<? Xml version = "1.0" encoding = "ISO-8859-1">
Anything outside the "proxool" tag is ignored.
<table Width="681" border="0"> <tr> <td width="399">
</ Td> <td width="272"> </ td> </ tr> </ table>
2, so write web.xml:
<? Xml version = "1.0" encoding = "ISO-8859-1">
Web-app
PUBLIC "- / / Sun Microsystems, Inc / / DTD Web Application 2.3 / / EN"
"Http://java.sun.com/dtd/web-app_2_3.dtd">
3, will be the driving procedures mm.mysql-2.0.14-bin.jar and proxool-0.8.3.jar and crimson.jar Add WEB-INF \ lib directory.
4, test jsp documents:
<% @ Page import = "java.sql .*"%>
<% @ Page contentType = "text / html; charset = GB2312"%>
<head>
</ Head>
<body>
Use Proxool Connection Pool with the xml file allocation
<%
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
Try (
Con = DriverManager.getConnection ( "proxool.xml-test");
Stmt = con.createStatement ();
String query = "select * from count_num";
Rs = stmt.executeQuery (query);
While (rs.next ()) (
Out.print (rs.getLong (1 )+"– OK ");
)
Stmt.close ();
Con.close ();
) Catch (SQLException sqle) (
Out.println ( "sqle =" + sqle);
)
Finally (
Try (
If (con! = Null) (
Con.close ();
)
) Catch (SQLException sqle) (
Out.println ( "sqle =" + sqle);
)
)
%>
</ Body>
5, statistics and background information
Please go to: http://127.0.0.1:8080/testpxool1/Admin
(Testpxool1 should read your application WEB) </ td> </ tr> <tr>
↑ Back
Tags: Connection, java mysql






