Revision 1094
Added by Jing Tao over 22 years ago
src/edu/ucsb/nceas/metacat/DBConnection.java | ||
---|---|---|
48 | 48 |
private long checkOutTime; |
49 | 49 |
private int usageCount;// how many time the connection was used |
50 | 50 |
private SQLWarning warningMessage; |
51 |
private String checkOutMethodName; |
|
51 | 52 |
|
52 | 53 |
|
53 | 54 |
private static String DBDriver=MetaCatUtil.getOption("dbDriver"); |
... | ... | |
70 | 71 |
checkOutTime = 0; |
71 | 72 |
usageCount= 0; |
72 | 73 |
warningMessage = null; |
74 |
checkOutMethodName = null; |
|
73 | 75 |
|
74 | 76 |
} |
75 | 77 |
|
... | ... | |
248 | 250 |
} |
249 | 251 |
|
250 | 252 |
/** |
253 |
* get the the name of method checked out the connection from the object |
|
254 |
*/ |
|
255 |
public String getCheckOutMethodName() |
|
256 |
{ |
|
257 |
return checkOutMethodName; |
|
258 |
} |
|
259 |
|
|
260 |
/** |
|
261 |
* Set a method name to the checkOutMethodName |
|
262 |
* @param myCheckOutMethodName, the name of method will assinged to it |
|
263 |
*/ |
|
264 |
public void setCheckOutMethodName(String myCheckOutMethodName) |
|
265 |
{ |
|
266 |
this.checkOutMethodName = myCheckOutMethodName; |
|
267 |
} |
|
268 |
|
|
269 |
/** |
|
251 | 270 |
* Close a DBConnection object |
252 | 271 |
*/ |
253 | 272 |
public void close() throws SQLException |
Also available in: Unified diff
Add a attribute named checkOutMethodName and relative method. This variable can keep track which mehod check out the DBConnection.