er.extensions
Class ERXJDBCUtilities
java.lang.Object
er.extensions.ERXJDBCUtilities
- public class ERXJDBCUtilities
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
public static ERXLogger log
TIMESTAMP_FORMATTER
public static NSTimestampFormatter TIMESTAMP_FORMATTER
ERXJDBCUtilities
public ERXJDBCUtilities()
jdbcTimestamp
public static String jdbcTimestamp(NSTimestamp t)
- Parameters:
t
-
- Returns:
dumpJDBCTypesFromPrototype
public static void dumpJDBCTypesFromPrototype(String prototypeName)
- Parameters:
prototypeName
-
copyDatabaseDefinedByEOModelAndConnectionDictionaryToDatabaseWithConnectionDictionary
public static void copyDatabaseDefinedByEOModelAndConnectionDictionaryToDatabaseWithConnectionDictionary(EOModel m,
NSDictionary sourceDict,
NSDictionary destDict)
copyTableDefinedByEntityAndConnectionToDatabaseWithConnection
public static void copyTableDefinedByEntityAndConnectionToDatabaseWithConnection(EOEntity entity,
Connection sourceCon,
Connection destCon,
boolean commitAtEnd)
- copies all rows from one database table to another database's table.
The table must be created before calling this method.
- Parameters:
entity
- the EOEntity which is related to the table which we want to copy
copyTableDefinedByEntityAndConnectionDictionaryToDatabaseWithConnectionDictionary
public static void copyTableDefinedByEntityAndConnectionDictionaryToDatabaseWithConnectionDictionary(EOEntity entity,
NSDictionary sourceDict,
NSDictionary destDict,
boolean commitAtEnd)
- copies all rows from one database to another database. The tabes must be created before calling
this method.
- Parameters:
entity
- the EOEntity which is related to the table which we want to copysourceDict
- a NSDictionary containing the following keys for the source database:
- username, the username for the connection
- password, the password for the connection
- url, the JDBC URL for the connection, for FrontBase its
jdbc:FrontBase://host/database
, for PostgreSQL its jdbc:postgresql://host/database
- driver, the full class name of the driver, for FrontBase its
com.frontbase.jdbc.FBJDriver
, for PostgreSQL its org.postgresql.Driver
- autoCommit, a Boolean defining if autoCommit should be on or off, default is true
- readOnly, a Boolean defining if the Connection is readOnly or not, default is false.
Its a good idea to make the sourceDict readOnly, because one does not write.
destDict
- same as sourceDict just used for the destination database.
columnsFromAttributes
public static String[] columnsFromAttributes(EOAttribute[] attributes,
boolean quoteNames)
connectionWithDictionary
public static Connection connectionWithDictionary(NSDictionary dict)
Copyright © 2002 – 2004 Project Wonder.