wangting
2025-01-16 18c43123b51a1688ab4ae01fe3d171c7d92e619b
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
package com.vci.server.base.dbutil;
 
import java.sql.Connection;
import java.sql.SQLException;
 
import javax.sql.DataSource;
 
public final class DBPoolManagement {
 
private static DataSource _myDataSource = null;
    
    static 
    {
        if ( _myDataSource == null )
        {
            DBPoolInit dbpi = new DBPoolInit();
            dbpi.InitProperties("");
            try
            {
                _myDataSource = dbpi.getDBPool();
            }
            catch(Exception e)
            {
                e.printStackTrace();
            }
        }        
    }
 
    public  static Connection getConnection() 
        throws SQLException
    {
        Connection conn = null;
        try 
        {
            conn = _myDataSource.getConnection();
        }
        catch (SQLException error) 
        {
          error.printStackTrace();
        }
        return conn;
    }
}