public class DB extends Object
| Constructor and Description |
|---|
DB(String dbName)
Create new DB instance
|
DB(String dbName,
String dbServer,
String dbUser,
String dbPassword) |
DB(String dbName,
String dbServer,
String dbUser,
String dbPassword,
boolean isDebug)
Create new DB instance
|
| Modifier and Type | Method and Description |
|---|---|
DB |
close()
Close Connection
|
DB |
disableDbmsOutput()
Disable DBMS_OUTPUT
|
DB |
enableDbmsOutput()
Enabled DBMS_OUTPUT
|
DB |
enableDbmsOutput(int size)
Enabled DBMS_OUTPUT
|
String |
getColumnName(int i)
Get Column name using column ID
|
Date |
getDate(int i,
String column)
Get Date from rowID and column
|
String |
getDbmsOutput()
Get DBMS_OUTPUT value
|
double |
getDouble(int i,
String column)
Get Double from rowID and column
|
float |
getFloat(int i,
String column)
Get Float from rowID and column
|
int |
getInt(int i,
String column)
Get Int from rowID and column
|
long |
getLong(int i,
String column)
Get Long from rowID and column
|
ResultSetMetaData |
getMetaData()
Get MetaData results
|
Object |
getObject(int i,
String column)
Get Object from rowID and column
|
Object[] |
getRow(int row)
Get Row data
|
HashMap<String,Object> |
getRowHashMap(int row)
Get Row Data in HashMap
|
LinkedHashMap<String,Object> |
getRowLinkedHashMap(int row)
Get Row Data in LinkedHashMap
|
int |
getRows()
Get Row count
|
String |
getString(int i,
String column)
Get String from rowID and column
|
Timestamp |
getTimestamp(int i,
String column)
Get Timestamp from rowID and column
|
DB |
logData()
Get log data in rows
|
DB |
logData(int rows)
Get log data in rows
|
DB |
query(String sql)
Execute the query
|
DB |
query(String sql,
HashMap<String,String> params)
Execute the query with parameters
|
DB |
queryFile(String filename,
HashMap<String,String> params)
Read SQL file and execute the query
|
void |
removeRow(int row)
Remove row from select results (not DB!)
|
public DB(String dbName)
dbName - - DB keypublic DB(String dbName, String dbServer, String dbUser, String dbPassword, boolean isDebug)
dbName - - DB NamedbServer - - DB serverdbUser - - DB userdbPassword - - DB passwordisDebug - - Debug Modepublic DB query(String sql) throws SQLException
sql - - SQL-запросSQLException - - exceptionpublic DB query(String sql, HashMap<String,String> params) throws SQLException
sql - - sql scriptparams - - parametersSQLException - - exceptionpublic DB queryFile(String filename, HashMap<String,String> params) throws IOException, SQLException
filename - - file nameparams - - parametersIOException - - exceptionSQLException - - exceptionpublic DB enableDbmsOutput(int size) throws SQLException
size - - DBMS_OUTPUT buffer sizeSQLException - - exceptionpublic DB enableDbmsOutput() throws SQLException
SQLException - - exceptionpublic DB disableDbmsOutput() throws SQLException
SQLException - - exceptionpublic String getDbmsOutput() throws SQLException
SQLException - - exceptionpublic void removeRow(int row)
row - - row IDpublic DB logData(int rows)
rows - - rows countpublic DB logData()
public DB close() throws SQLException
SQLException - - exceptionpublic Object[] getRow(int row)
row - - row IDpublic HashMap<String,Object> getRowHashMap(int row)
row - - row IDpublic LinkedHashMap<String,Object> getRowLinkedHashMap(int row)
row - - row IDpublic int getRows()
public ResultSetMetaData getMetaData()
public Object getObject(int i, String column)
i - - row IDcolumn - - column namepublic String getColumnName(int i)
i - - column IDpublic int getInt(int i,
String column)
i - - row IDcolumn - - column namepublic float getFloat(int i,
String column)
i - - row IDcolumn - - column namepublic long getLong(int i,
String column)
i - - row IDcolumn - - column namepublic Timestamp getTimestamp(int i, String column)
i - - row IDcolumn - - column namepublic double getDouble(int i,
String column)
i - - row IDcolumn - - column namepublic String getString(int i, String column)
i - - row IDcolumn - - column nameCopyright © 2018. All rights reserved.