public class DBConnector extends java.lang.Object implements Connector
| Modifier and Type | Field and Description |
|---|---|
protected int |
resultType |
protected int |
sqlExecTimeout |
protected java.lang.String |
uri |
| Constructor and Description |
|---|
DBConnector(java.util.Map props) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
commit() |
int |
copyStream(int len,
java.io.InputStream in,
java.lang.String sqlStr)
It assumes the SQL statement updating on a single column of BLOB.
|
int |
copyStream(java.lang.String sqlStr,
java.io.OutputStream out)
It assumes the SQL statement querying on a single column of BLOB.
|
int |
executeQuery(java.lang.String sqlStr)
returns the number of rows changed for update, insert and delete only
|
java.lang.String |
getURI() |
boolean |
isConnected() |
java.lang.StringBuffer |
list(java.lang.String table,
int[] rc)
returns a string buffer with info on all columns for a specific table
|
java.util.List<java.lang.Object> |
list(java.lang.String pattern,
java.lang.String[] types)
returns the list of all objects for the specific types
|
java.lang.StringBuffer |
list(java.lang.String pattern,
java.lang.String[] types,
int[] rc)
returns a string buffer with info on all objects for the types
|
static void |
main(java.lang.String[] args) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String str)
returns the prepared statement
|
java.lang.String |
reconnect()
reconnects to the DB and returns null on success or err msg otherwise
|
void |
rollback() |
java.lang.StringBuffer |
select(java.lang.String sqlStr,
int[] rc)
returns selected result in string buffer for the query
|
void |
setAutoCommit(boolean ac) |
protected java.lang.String uri
protected int resultType
protected int sqlExecTimeout
public int copyStream(java.lang.String sqlStr,
java.io.OutputStream out)
throws java.io.IOException
java.io.IOExceptionpublic int copyStream(int len,
java.io.InputStream in,
java.lang.String sqlStr)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.StringBuffer select(java.lang.String sqlStr,
int[] rc)
throws java.sql.SQLException
java.sql.SQLExceptionpublic int executeQuery(java.lang.String sqlStr)
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.lang.StringBuffer list(java.lang.String pattern,
java.lang.String[] types,
int[] rc)
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.util.List<java.lang.Object> list(java.lang.String pattern,
java.lang.String[] types)
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.lang.StringBuffer list(java.lang.String table,
int[] rc)
throws java.sql.SQLException
java.sql.SQLExceptionpublic boolean isConnected()
isConnected in interface Connectorpublic java.lang.String reconnect()
public void commit()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void rollback()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void setAutoCommit(boolean ac)
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.sql.PreparedStatement prepareStatement(java.lang.String str)
throws java.sql.SQLException
java.sql.SQLExceptionpublic static void main(java.lang.String[] args)