Administrator
2022-10-19 bec9d52048d24f89ac665aa4b5abb726e212df63
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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
 */