mysql的
<resource-ref>
<res-ref-name>jdbc/test</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<init-param driver-name="com.caucho.jdbc.mysql.Driver"/>
<init-param url="jdbc:mysql_caucho://localhost:3306/test"/>
<init-param user="sa"/>
<init-param password=""/>
<init-param max-connections="20"/>
<init-param max-idle-time="30"/>
</resource-ref>
sybase的
<resource-ref>
<res-ref-name>cnews</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<init-param driver-name="com.sybase.jdbc2.jdbc.SybDriver"/>
<init-param url="jdbc:sybase:Tds:192.168.0.20:4200/mtgdbs?charset=cp936&jconnect_version=2"/>
<init-param user="sa"/>
<init-param password=""/>
<init-param max-connections="20"/>
<init-param max-idle-time="30"/>
</resource-ref>
Connection conn=DBPool.getPool("cnews").getConnection(); //2
Statement stmt = conn.createStatement();
直连
String url="jdbc:mysql://localhost:3306/note?useUnicode=true&characterEncoding=UTF-8";
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection(url,"sa","");
stmt=con.createStatement();