public class DBSession extends Object
Modifier and Type | Field and Description |
---|---|
protected Connection |
connection |
protected static String |
DB_DIR |
protected static String |
DB_DRIVER_CLASS |
protected static String |
dbDirPath |
Modifier | Constructor and Description |
---|---|
protected |
DBSession()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
commit() |
static Connection |
connectDB(String scope) |
void |
createIndex(String tableName,
String columnName) |
void |
deleteColumn(String tableName,
String columnName) |
int |
deleteOperation(String tableName,
List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters) |
void |
disableAutoCommit() |
void |
disableKeys(String tableName) |
static void |
dropDataBase(String scope) |
void |
dropTable(String table) |
void |
enableKeys(String tableName) |
static void |
executeBatch(Connection connection,
String batchFile) |
ResultSet |
executeFilteredQuery(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters,
String table,
String orderColumn,
String orderMode) |
ResultSet |
executeQuery(String query)
Deprecated.
|
int |
executeUpdate(String query)
Deprecated.
|
PreparedStatement |
fillParameters(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> fields,
int parameterOffset,
PreparedStatement ps) |
protected static String |
formDeletetQueryStringFromFields(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters,
String table) |
protected static String |
formSelectCountString(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters,
String tableName) |
protected static String |
formSelectQueryStringFromFields(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters,
String table,
String sortColumn,
String sortDirection) |
protected static String |
formUpdateQuery(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> toSet,
List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> keys,
String tableName) |
Connection |
getConnection() |
int |
getCount(String tableName,
List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters) |
protected List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field>> |
getGeneratedKeys(PreparedStatement ps) |
static DBSession |
getInstance(String scope) |
protected PreparedStatement |
getPreparedStatementForCount(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters,
String tableName) |
PreparedStatement |
getPreparedStatementForDelete(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> fields,
String table) |
PreparedStatement |
getPreparedStatementForInsert(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> fields,
String table) |
PreparedStatement |
getPreparedStatementForInsertFromSelect(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> fields,
String destTable,
String srcTable) |
PreparedStatement |
getPreparedStatementForQuery(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters,
String table,
String orderColumn,
String orderDirection) |
PreparedStatement |
getPreparedStatementForUpdate(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> toSet,
List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> keys,
String tableName) |
int |
getTableCount(String tableName) |
static void |
initializeDB(File dbDir) |
List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field>> |
insertOperation(String tableName,
List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field>> rows) |
PreparedStatement |
preparedStatement(String query)
Deprecated.
|
List<List<String>> |
showTableMetadata(String tableName,
String... whereClause) |
int |
updateOperation(String tableName,
List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field>> keys,
List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field>> rows) |
protected static final String DB_DIR
protected static final String DB_DRIVER_CLASS
protected static String dbDirPath
protected Connection connection
@Deprecated protected DBSession()
public static void dropDataBase(String scope)
public Connection getConnection()
public static void executeBatch(Connection connection, String batchFile) throws Exception
Exception
public static Connection connectDB(String scope) throws Exception
Exception
@Deprecated public ResultSet executeQuery(String query) throws Exception
query
- Exception
public void createIndex(String tableName, String columnName) throws Exception
Exception
public void deleteColumn(String tableName, String columnName) throws Exception
Exception
public List<List<String>> showTableMetadata(String tableName, String... whereClause) throws Exception
Exception
protected PreparedStatement getPreparedStatementForCount(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters, String tableName) throws SQLException
SQLException
public PreparedStatement getPreparedStatementForQuery(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters, String table, String orderColumn, String orderDirection) throws SQLException
SQLException
public PreparedStatement getPreparedStatementForUpdate(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> toSet, List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> keys, String tableName) throws SQLException
SQLException
public PreparedStatement getPreparedStatementForInsertFromSelect(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> fields, String destTable, String srcTable) throws Exception
Exception
public PreparedStatement getPreparedStatementForInsert(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> fields, String table) throws Exception
Exception
public PreparedStatement getPreparedStatementForDelete(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> fields, String table) throws Exception
Exception
@Deprecated public PreparedStatement preparedStatement(String query) throws Exception
Exception
public PreparedStatement fillParameters(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> fields, int parameterOffset, PreparedStatement ps) throws SQLException
SQLException
public List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field>> insertOperation(String tableName, List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field>> rows) throws Exception
Exception
public int updateOperation(String tableName, List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field>> keys, List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field>> rows) throws Exception
Exception
public ResultSet executeFilteredQuery(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters, String table, String orderColumn, String orderMode) throws Exception
Exception
public int getCount(String tableName, List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters) throws Exception
Exception
public int deleteOperation(String tableName, List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters) throws Exception
Exception
@Deprecated public int executeUpdate(String query) throws Exception
Exception
protected List<List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field>> getGeneratedKeys(PreparedStatement ps) throws SQLException
SQLException
protected static String formSelectQueryStringFromFields(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters, String table, String sortColumn, String sortDirection)
protected static String formSelectCountString(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters, String tableName)
protected static String formDeletetQueryStringFromFields(List<org.gcube.application.aquamaps.aquamapsservice.stubs.fw.model.Field> filters, String table)
Copyright © 2018. All Rights Reserved.