db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Db-derby Wiki] Update of "MysqlDerbyMigration/DesignDocument" by RaminMoazeni
Date Mon, 10 Jul 2006 08:49:00 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Db-derby Wiki" for change notification.

The following page has been changed by RaminMoazeni:
http://wiki.apache.org/db-derby/MysqlDerbyMigration/DesignDocument

------------------------------------------------------------------------------
  
  == Ramin Moazeni ==
  
- == Version 1.1 ==
+ == Version 1.2 ==
  
    
  = Introduction =
@@ -209, +209 @@

    </table>
  </database> }}}
  
+ The DdlUtils tool handles datatype mappings using JDBC datatypes rather than SQL datatypes
which are
+ database dependent. Looking at http://db.apache.org/ddlutils/database-support.html, we can
see the datatype mapping between JDBC types and SQL types. For example, a TIINYINT datatype
from MySQL, will be mapped to SMALLINT in Derby.
  
- In order to use DdlUtils component to migrate the source database to the target database,
following steps are suggested: 
+ Please note that the DdlUtils doesn’t support views, constraints (CHECK constraint), triggers,
stored procedures, etc. A possible solution would be to execute database-specific commands
or to read source database system tables to capture required information. As an example, MySQL
provide the following SHOW commands to capture the exact string that was used to create the
original object:
  
-  * Capture DDL file from DdlUtils. 
-  * Modify the source DDL to the target DDL using Serialization and Deserialization of XML.

-  * Fed in the new DDL file to the DdlUtils. 
+ || SHOW CREATE TABLE ||
+ || SHOW CREATE VIEW ||
+ || SHOW DATABASES ||
+ || SHOW TRIGGERS ||
+ || SHOW CREATE PROCEDURE ||
+ || SHOW CREATE FUNCTION ||
  
- In order to easily work with XML files, the use of Serialization and Deserialization of
XML is suggested. XML files can be deserialized to Java objects. Therefore, we are dealing
with objects afterwards. After modifying the value of object attributes based on datatype
mappings of table 1, objects can be serialized to XML files and be used by the DdlUtils to
create the corresponding database.
+ = Recommended Approach =
  
- Please note that the DdlUtils doesn’t support non-table entities, constraints, triggers,
stored procedures, etc. A possible solution would be to execute database-specific commands
to capture required information.
+ I suggest that the DatabaseMetaData approach is used for implemntation of the MySQL to Derby
Migration tool for migration of view, constraints, and stored procedures and use the DdlUtils
component for migration of database tables.
+ 
+ = Performance =
+ 
+ In order to improve performance, the batch update facility can be used to allow multiple
update operations to be submitted to a data source for processing at once. The Statement object
can keep track of a list of commands that can be submitted together for execution. The Statement.addBatch
method can be used to add commands to a statement’s batch by providing it with the SQL command
that needs to be added.
+ 
+ 
+ Submitting multiple updates together, instead of single updates, can greatly improve performance.

+ 
+ 
+ = Internationalization =
+ 
+ 
  
  = Initial Prototypes =
  

Mime
View raw message