Project Wonder 2.0

er.extensions
Class ERXJDBCUtilities

java.lang.Object
  extended byer.extensions.ERXJDBCUtilities

public class ERXJDBCUtilities
extends Object


Field Summary
static ERXLogger log
           
static NSTimestampFormatter TIMESTAMP_FORMATTER
           
 
Constructor Summary
ERXJDBCUtilities()
           
 
Method Summary
static String[] columnsFromAttributes(EOAttribute[] attributes, boolean quoteNames)
           
static Connection connectionWithDictionary(NSDictionary dict)
           
static void copyDatabaseDefinedByEOModelAndConnectionDictionaryToDatabaseWithConnectionDictionary(EOModel m, NSDictionary sourceDict, NSDictionary destDict)
           
static void copyTableDefinedByEntityAndConnectionDictionaryToDatabaseWithConnectionDictionary(EOEntity entity, NSDictionary sourceDict, NSDictionary destDict, boolean commitAtEnd)
          copies all rows from one database to another database.
static void copyTableDefinedByEntityAndConnectionToDatabaseWithConnection(EOEntity entity, Connection sourceCon, Connection destCon, boolean commitAtEnd)
          copies all rows from one database table to another database's table.
static void dumpJDBCTypesFromPrototype(String prototypeName)
           
static String jdbcTimestamp(NSTimestamp t)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static ERXLogger log

TIMESTAMP_FORMATTER

public static NSTimestampFormatter TIMESTAMP_FORMATTER
Constructor Detail

ERXJDBCUtilities

public ERXJDBCUtilities()
Method Detail

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 copy
sourceDict - a NSDictionary containing the following keys for the source database:
  1. username, the username for the connection
  2. password, the password for the connection
  3. url, the JDBC URL for the connection, for FrontBase its jdbc:FrontBase://host/database , for PostgreSQL its jdbc:postgresql://host/database
  4. driver, the full class name of the driver, for FrontBase its com.frontbase.jdbc.FBJDriver , for PostgreSQL its org.postgresql.Driver
  5. autoCommit, a Boolean defining if autoCommit should be on or off, default is true
  6. 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)

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.