public class PgRunner extends Object
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkAndCreateTable(String tableName) |
protected String |
getColumnType(Class<?> objClass) |
protected PreparedStatement |
getPreparedStatement(String command,
Object[] values) |
Set<String> |
getTableColumns(String tableName)
Gets the columns in the table.
|
boolean |
insert(String command,
Object[] values)
Runs an insert command.
|
Map<String,Object> |
retrieveOne(String command,
Object[] values,
Map<String,Class<?>> colTypes)
Retrieves a single object from the DB.
|
public PgRunner(String url)
url - The database url to connect to.public Set<String> getTableColumns(String tableName)
tableName - The name of the tablepublic boolean insert(String command, Object[] values)
command - The command to runvalues - the values to add to the commandpublic Map<String,Object> retrieveOne(String command, Object[] values, Map<String,Class<?>> colTypes)
command - The command to runvalues - The values to fillcolTypes - The types of each columnprotected void checkAndCreateTable(String tableName)
protected PreparedStatement getPreparedStatement(String command, Object[] values)
Copyright © 2016. All rights reserved.