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: 

  <? Xml version = "1.0" encoding = "ISO-8859-1"> 
  Anything outside the "proxool" tag is ignored. 
  <table Width="681" border="0"> <tr> <td width="399"> 


  Xml-test 
  Jdbc: mysql: / / localhost: 3306/soft 
  Org.gjt.mm.mysql.Driver 




10
  Select CURRENT_DATE 




  </ 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"> 



ServletConfigurator


  Org.logicalcobwebs.proxool.configuration.ServletConfigurator 


  XmlFile 

WEB-INF/classes/Proxool.xml

  A 



Admin
  Org.logicalcobwebs.proxool.admin.servlet.AdminServlet 



Admin
  / Admin 





  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 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Facebook
  • DotNetKicks
  • DZone
  • Netvouz
  • Propeller

Tags: ,

Releated Java Articles

Comments

Leave a Reply