ru.tehkode.permissions.backends.sql
Class SQLConnection
java.lang.Object
ru.tehkode.permissions.backends.sql.SQLConnection
public class SQLConnection
- extends Object
- Author:
- code
placeholderPattern
protected static Pattern placeholderPattern
db
protected Connection db
uri
protected String uri
user
protected String user
password
protected String password
dbDriver
protected String dbDriver
aliases
protected Map<String,String> aliases
SQLConnection
public SQLConnection(String uri,
String user,
String password,
String dbDriver)
setAlias
public void setAlias(String tableName,
String alias)
getAlias
public String getAlias(String tableName)
selectQuery
public ResultSet selectQuery(String sql,
Object... params)
throws SQLException
- Throws:
SQLException
selectQueryOne
public Object selectQueryOne(String sql,
Object fallback,
Object... params)
updateQuery
public void updateQuery(String sql,
Object... params)
insert
public void insert(String table,
String[] fields,
List<Object[]> rows)
throws SQLException
- Throws:
SQLException
isTableExist
public boolean isTableExist(String tableName)
isFieldExists
public boolean isFieldExists(String tableName,
String fieldName)
checkConnection
protected void checkConnection()
throws SQLException
- Throws:
SQLException
connect
protected final void connect()
throws SQLException
- Throws:
SQLException
getDriverClass
protected static String getDriverClass(String alias)
bindParams
protected void bindParams(PreparedStatement stmt,
Object[] params)
throws SQLException
- Throws:
SQLException
prepareQuery
protected String prepareQuery(String sql)
finalize
protected void finalize()
throws Throwable
- Overrides:
finalize
in class Object
- Throws:
Throwable
Copyright © 2011. All Rights Reserved.