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.IOException
public int copyStream(int len, java.io.InputStream in, java.lang.String sqlStr) throws java.io.IOException
java.io.IOException
public java.lang.StringBuffer select(java.lang.String sqlStr, int[] rc) throws java.sql.SQLException
java.sql.SQLException
public int executeQuery(java.lang.String sqlStr) throws java.sql.SQLException
java.sql.SQLException
public java.lang.StringBuffer list(java.lang.String pattern, java.lang.String[] types, int[] rc) throws java.sql.SQLException
java.sql.SQLException
public java.util.List<java.lang.Object> list(java.lang.String pattern, java.lang.String[] types) throws java.sql.SQLException
java.sql.SQLException
public java.lang.StringBuffer list(java.lang.String table, int[] rc) throws java.sql.SQLException
java.sql.SQLException
public boolean isConnected()
isConnected
in interface Connector
public java.lang.String reconnect()
public void commit() throws java.sql.SQLException
java.sql.SQLException
public void rollback() throws java.sql.SQLException
java.sql.SQLException
public void setAutoCommit(boolean ac) throws java.sql.SQLException
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String str) throws java.sql.SQLException
java.sql.SQLException
public static void main(java.lang.String[] args)