Revision 41076
Added by Giorgos Alexiou over 8 years ago
DB.java | ||
---|---|---|
12 | 12 |
|
13 | 13 |
public class DB { |
14 | 14 |
|
15 |
private static Logger log = Logger.getLogger(DB.class);
|
|
15 |
private Logger log = Logger.getLogger(DB.class); |
|
16 | 16 |
|
17 |
private static BoneCPDataSource ds;
|
|
18 |
private static BoneCP connectionPool;
|
|
17 |
private BoneCPDataSource ds; |
|
18 |
private BoneCP connectionPool; |
|
19 | 19 |
|
20 | 20 |
public DB(){ |
21 | 21 |
|
... | ... | |
52 | 52 |
// |
53 | 53 |
// } |
54 | 54 |
|
55 |
public static BoneCPDataSource getDatasource(String conLine, String username, String password, String minCpart, String maxCpart, String part) throws IOException, SQLException, PropertyVetoException {
|
|
55 |
public BoneCPDataSource getDatasource(String conLine, String username, String password, String minCpart, String maxCpart, String part) throws IOException, SQLException, PropertyVetoException { |
|
56 | 56 |
try { |
57 | 57 |
// // load the database driver (make sure this is in your classpath!) |
58 | 58 |
Class.forName("virtuoso.jdbc4.Driver"); |
... | ... | |
75 | 75 |
} |
76 | 76 |
|
77 | 77 |
|
78 |
public static BoneCP getConnectionPool(String conLine, String username, String password, String minCpart, String maxCpart, String part) throws IOException, SQLException, PropertyVetoException {
|
|
78 |
public BoneCP getConnectionPool(String conLine, String username, String password, String minCpart, String maxCpart, String part) throws IOException, SQLException, PropertyVetoException { |
|
79 | 79 |
try { |
80 | 80 |
// // load the database driver (make sure this is in your classpath!) |
81 | 81 |
Class.forName("virtuoso.jdbc4.Driver"); |
... | ... | |
96 | 96 |
|
97 | 97 |
} |
98 | 98 |
|
99 |
public static void closeConnectionPool() throws SQLException {
|
|
99 |
public void closeConnectionPool() throws SQLException { |
|
100 | 100 |
connectionPool.shutdown(); |
101 | 101 |
} |
102 | 102 |
|
103 |
public static void closeDatasource() throws SQLException {
|
|
103 |
public void closeDatasource() throws SQLException { |
|
104 | 104 |
ds.close(); |
105 | 105 |
} |
106 | 106 |
|
Also available in: Unified diff
DB changes