package com.sql; import com.mchange.v2.c3p0.ComboPooledDataSource; import java.beans.PropertyVetoException; import java.sql.Connection; import java.sql.SQLException; public class SybaseConnPool { private ComboPooledDataSource sybase_ds = new ComboPooledDataSource(); public SybaseConnPool() { try { init(); } catch (PropertyVetoException e) { e.printStackTrace(); } } public void init() throws PropertyVetoException { this.sybase_ds.setDriverClass("com.sybase.jdbc3.jdbc.SybDriver"); this.sybase_ds.setJdbcUrl("jdbc:sybase:Tds:192.168.48.129:5000/battdata?language=us_english&charset=cp936"); this.sybase_ds.setUser("sa"); this.sybase_ds.setPassword(""); this.sybase_ds.setMaxPoolSize(3); this.sybase_ds.setMinPoolSize(1); } public Connection getConn() { Connection con = null; try { con = this.sybase_ds.getConnection(); } catch (SQLException e) { e.printStackTrace(); } return con; } } /* * Location: * C:\Users\LiJun\Desktop\公司各种设备资料\9600显示模块相关文件\后台程序\2018-09-07\BattFBS9600XSP. * jar Qualified Name: com.sql.SybaseConnPool JD-Core Version: 0.6.2 */