|
BrokenEvent nanotests | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.brokenevent.nanotests.db.ConnectionWrapper
public class ConnectionWrapper
Simple SQL connection wrapper for connection pooling.
Constructor Summary | |
---|---|
ConnectionWrapper(java.lang.String connectionString,
java.lang.String login,
java.lang.String password)
Creates and initializes wrapper with a connection. |
Method Summary | |
---|---|
void |
close()
Closes the statement created by this wrapper and releases the wrapper for further usage. |
java.sql.Statement |
getStatement()
Create the SQL statement. |
boolean |
isBusy()
Checks if the connection wrapper is busy (in use and not released) now. |
void |
release()
Releases the connection wrapper and its SQL connection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConnectionWrapper(java.lang.String connectionString, java.lang.String login, java.lang.String password) throws java.sql.SQLException
connectionString
- SQL server connection stringlogin
- DB loginpassword
- DB password
java.sql.SQLException
- when the DriverManager
is failed to open connectionMethod Detail |
---|
public java.sql.Statement getStatement() throws java.sql.SQLException
statement.close()
after all operations done.
Use wrapper.close()
(close()
) instead.
java.sql.SQLException
- when connection is failed to create statementpublic boolean isBusy()
public void close() throws java.sql.SQLException
java.sql.SQLException
- when statement is failed to closepublic void release() throws java.sql.SQLException
java.sql.SQLException
- when connection is failed to close
|
BrokenEvent nanotests | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |