Package org.ujmp.jdbc.table
Class JDBCTable
java.lang.Object
org.ujmp.core.collections.AbstractCollection<Map<String,Object>>
org.ujmp.jdbc.table.AbstractTable
org.ujmp.jdbc.table.JDBCTable
- All Implemented Interfaces:
Serializable
,Iterable<Map<String,
,Object>> Collection<Map<String,
,Object>> Table
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Connection
private PreparedStatement
private PreparedStatement
protected Map<Set<String>,
PreparedStatement> private PreparedStatement
protected String
protected PreparedStatement
private static final long
private boolean
protected String
private PreparedStatement
protected PreparedStatement
protected String
protected String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
void
clear()
static JDBCTable
connectToHSQLDB
(File filename, String tableName, String... columnForKeys) static JDBCTable
connectToMySQL
(String serverName, int port, String databaseName, String tableName, String userName, String password) static JDBCTable
connectToMySQL
(String serverName, int port, String databaseName, String tableName, String username, String password, String... columnsForKeys) boolean
protected Connection
private void
initDatabase
(Map<String, Object> fieldsAndValues) iterator()
boolean
int
size()
boolean
boolean
Methods inherited from class org.ujmp.jdbc.table.AbstractTable
add, containsAll, getAll, getFirst, removeAll, retainAll
Methods inherited from class org.ujmp.core.collections.AbstractCollection
addAll, isEmpty, toArray, toArray
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Collection
addAll, equals, hashCode, isEmpty, parallelStream, removeIf, spliterator, stream, toArray, toArray
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
url
-
username
-
password
-
columnsForKeys
-
tableName
-
tableExists
private boolean tableExists -
connection
-
truncateTableStatement
-
insertStatements
-
updateStatement
-
deleteStatement
-
selectStatement
-
countStatement
-
keyStatement
-
-
Constructor Details
-
JDBCTable
-
-
Method Details
-
getConnection
- Throws:
SQLException
-
tableExists
- Throws:
SQLException
-
initDatabase
- Throws:
SQLException
-
connectToMySQL
public static JDBCTable connectToMySQL(String serverName, int port, String databaseName, String tableName, String username, String password, String... columnsForKeys) throws SQLException - Throws:
SQLException
-
connectToMySQL
public static JDBCTable connectToMySQL(String serverName, int port, String databaseName, String tableName, String userName, String password) throws SQLException - Throws:
SQLException
-
connectToHSQLDB
-
add
-
getFirst
-
getAll
-
size
public int size() -
contains
-
iterator
-
remove
-
clear
public void clear() -
update
-