|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectru.tehkode.permissions.backends.sql.SQLConnection
public class SQLConnection
| Field Summary | |
|---|---|
protected Map<String,String> |
aliases
|
protected Connection |
db
|
protected String |
dbDriver
|
protected String |
password
|
protected static Pattern |
placeholderPattern
|
protected String |
uri
|
protected String |
user
|
| Constructor Summary | |
|---|---|
SQLConnection(String uri,
String user,
String password,
String dbDriver)
|
|
| Method Summary | |
|---|---|
protected void |
bindParams(PreparedStatement stmt,
Object[] params)
|
protected void |
checkConnection()
|
protected void |
connect()
|
protected void |
finalize()
|
String |
getAlias(String tableName)
|
protected static String |
getDriverClass(String alias)
|
void |
insert(String table,
String[] fields,
List<Object[]> rows)
|
boolean |
isFieldExists(String tableName,
String fieldName)
|
boolean |
isTableExist(String tableName)
|
protected String |
prepareQuery(String sql)
|
ResultSet |
selectQuery(String sql,
Object... params)
|
Object |
selectQueryOne(String sql,
Object fallback,
Object... params)
|
void |
setAlias(String tableName,
String alias)
|
void |
updateQuery(String sql,
Object... params)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static Pattern placeholderPattern
protected Connection db
protected String uri
protected String user
protected String password
protected String dbDriver
protected Map<String,String> aliases
| Constructor Detail |
|---|
public SQLConnection(String uri,
String user,
String password,
String dbDriver)
| Method Detail |
|---|
public void setAlias(String tableName,
String alias)
public String getAlias(String tableName)
public ResultSet selectQuery(String sql,
Object... params)
throws SQLException
SQLException
public Object selectQueryOne(String sql,
Object fallback,
Object... params)
public void updateQuery(String sql,
Object... params)
public void insert(String table,
String[] fields,
List<Object[]> rows)
throws SQLException
SQLExceptionpublic boolean isTableExist(String tableName)
public boolean isFieldExists(String tableName,
String fieldName)
protected void checkConnection()
throws SQLException
SQLException
protected final void connect()
throws SQLException
SQLExceptionprotected static String getDriverClass(String alias)
protected void bindParams(PreparedStatement stmt,
Object[] params)
throws SQLException
SQLExceptionprotected String prepareQuery(String sql)
protected void finalize()
throws Throwable
finalize in class ObjectThrowable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||