Package net.simplace.core.service
Class DatabaseHelper
java.lang.Object
net.simplace.core.service.DatabaseHelper
Provides some methods for performing database operations.
It's not implemented as static methods to share some ressources.
It's not implemendes as singleton to avoid snychronisation problems.
- Author:
- Andreas Enders
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
copyData
(boolean doDropBeforeCopy, Connection aSourceConnection, String aSourceTableName, Connection aTargetConnection, String aTargetTableName) static LinkedHashMap<String,
LinkedList<Object>> readResult
(Connection aConnection, String aStatement)
-
Constructor Details
-
DatabaseHelper
public DatabaseHelper()
-
-
Method Details
-
copyData
public static void copyData(boolean doDropBeforeCopy, Connection aSourceConnection, String aSourceTableName, Connection aTargetConnection, String aTargetTableName) throws SQLException - Parameters:
doDropBeforeCopy
-aSourceConnection
-aSourceTableName
-aTargetConnection
-aTargetTableName
-- Throws:
SQLException
-
readResult
public static LinkedHashMap<String,LinkedList<Object>> readResult(Connection aConnection, String aStatement) - Parameters:
aConnection
-aStatement
-- Returns:
- the complete result of the statement as Map of columns
-