DB Migration from MYSQL to ORACLE Using Offline Capture

Hi
Am doing a database migration from MySQL to Oracle using SQL Developer (version 2.1.1.64). So far, I've successfully captured the MySQL database and converted it to the Oracle Model. However, when generating offline scripts to create the converted model schema into Oracle DDL scripts it managed to generate SQL to create: 1) User 2) Sequences 3) Tables 4) Triggers and 5) constraints.
It has created the SQL to add the primary key constraints and index constraints. Although it did the foreign key constraints in the SQL, the foreign key constraints seems to have missed the cascading options for the foreign key constraint. I.e. theres no reference of whether the foreign key constraint will restrict on delete or cascade etc.
We have a foreign keys in the MySql database that have different cascading options and these have not being ported over into the migration SQL. Therefore, all the foreign keys generated in the SQL by default are cascade to restrict on delete.
Does 'Generate Oracle DDL' not take into account a foreign key's on delete cascading option?
Any help or information would be greatly appreciated.
Thanks

Hello,
that reminded me for the following thread:
Migration Microsoft SQL Sever 2005 to Oracle 11g cascade on delete problem
That is a similar issue, isn't it?
I opened a bug for that, and it will be fixed in SQL Developer 3.1 (not in any 3.0 Early Adopter version). If you hit the same issue, there is no other way then using the workaround as used in the mentioned thread.
Regards
Wolfgang

Similar Messages

  • Migrating from MySQL to Oracle 11g

    can u tell me the steps to migrating database from MySQL to Oracle using SQL Developer?
    I have installed Oracle 11g(11.1.0.6.0) in server and SQl Developer in my local system.
    I connected to MySQL and Oracle in SQL Developer and tried to MIgrate everything in MySQL to Oracle using Quick Migrate option.
    it took one and half day but didn't work at last...
    is there any pre tasks that i need to do before migrating to oracle from MySQL?
    and also when i export the MySQL data to Oracle using SQL Developer,it is giving data type mismatch errors like (date, boolean etc...).
    please give a reply what i need to do and any refferences also very much appreciated.

    hi Turloch ,
    I followed the steps mentioned above.
    When I right click my MySQL server db Connection and click "Capture MySQL server", it just shows a dialog with "Close" enabled.
    after clicking the close button, it gives following error messages.
    oracle.dbtools.metadata.persistence.PersistableObject.doInsert(PersistableObject.java:238)
    the same error is coming no of times.
    Kindly help me in this regard.

  • Problem while migrating from Sybase to Oracle using Quick Migrate

    Hi,
    For SQL Developer version 2.1, while migrating from sybase to oracle, Using Quick migrate, during data move step, for the rows having ''(Blank) values in TEXT data type in SYBASE, which is convertd to CLOB in Oracle, the migration for that table terminates at that row.
    However, NULL values in Sybase TEXT data type are successfully inserted in Oracle CLOB.
    How can we overcome this?

    reproduced and see exception in console, bug logged.
    Edited by: Jade Zhong on Feb 1, 2010 6:10 PM

  • Out of memory error in migrating from mysql to oracle

    Hi,
    I'm trying migrate from mysql to oracle9i. The hardware and software requirements are matching or even much higher than mentioned in the documentation. I have installed OMWB is properly(hope so). When I try to migrate the desired database from mysql to oracle, the repository, the Oracle model are created successfully. But while migrating data, say for around 35000 rows insertion everything works pretty fine. But after sometime, the migration stops and no error or anything appears in the screen.And in the Errorlog I get "OutOfMemoryError".
    I tried to migrate single table also. But I still get this problem after sometime. The tables may contain from 10 - 130000 rows...
    I even tried to change the %JRE..% memory value to 64M or 128M in the omwb.bat file and the O/s is Microsoft Windows XP, RAM 256MB.
    Any help is much appreciated.
    Thanks in advance.

    Hi Viji,
    did the message in the error.log provide any extra information? For example, was the OutOfMemory error prefixed with a string
    like "cannot create new native thread" ? My suggestion to workaround the problem would have been to increase the JVM heap size to 128
    but this appears to have been unsuccessful for you. Can you send a mail to the Migration Workbench support services
    ([email protected]) explaining the problem, and attach the full error.log file please ? (please also copy me on the mail).
    In the meantime, you can workaround this by migrating the schema only (there is a switch on step 3 of the migration wizard asking:
    "Do you want to migrate the table data to Oracle?" - just select the "No" option). When the schema has migrated, you can then use the
    offline data loading facility to migrate the data. This uses data extraction scripts and SDQL*Loader to migrate the data to the target
    Oracle database.You can learn more about the offline data loading facility from the plugins referenceguide (from the Help menu in
    the Migration Workbench).
    I hope this helps,
    Tom.

  • How to handle DATE type problems in migrating from mysql to oracle.?

    Hi,
    I'm migrating only the data from mysql to oracle with the help of sql loader.But with this type i cannot able to insert the date values from mysql to oracle.In mysql i have defined date as "DATETIME" type and in oracle it is in TimeStamp.Whenever i'm inserting the values thru CTL file ,i'm getting an error invalid date format entered.How to solve this problem?
    Thanks in Advance
    JAI

    you need to supply a mask to the timestamp entry. see http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_field_list.htm#i1006714 for details on datatypes within the ctl file
    B

  • Issue during migrating from Sybase to Oracle using Oracle SQL Developer

    I am using SQL Developer v 3.2.20.09 to migrate from Sybase to Oracle Pl/SQL 12c
    While migrating the stored procedure the following block did not convert. I got NULL instead of object_id:
    Sybase Block:
    IF OBJECT_ID(‘dbo.CheckEst’) IS NOT NULL
    BEGIN
    DROP PROCEDURE dbo.CheckEst
    IF OBJECT_ID(‘dbo.CheckEst’) IS NOT NULL
    PRINT ‘<<>>’
    ELSE
    PRINT ‘<<>>’
    END
    Oracle Block after conversion:
    BEGIN
    IF NULL/*TODO:OBJECT_ID(‘dbo.CheckEst’)*/ IS NOT NULL THEN
    BEGIN
    DROP PROCEDURE CheckEst;
    IF NULL/*TODO:OBJECT_ID(‘dbo.CheckEst’)*/ IS NOT NULL THEN
    DBMS_OUTPUT.PUT_LINE(‘<<>>’);
    ELSE
    DBMS_OUTPUT.PUT_LINE(‘<<>>’);
    END IF;
    END;
    END IF;
    END;
    Lines 1 & 4 got converted to NULL. I have many places where such code is written.
    Is there any quick way to overcome such an issue? or what needs to be done in such case?

    Hi,
      You are using an older version of SQL*Developer.  Could you download the latest 4.0.2 version available from here -
    Oracle SQL Developer
    and check if you still have the problem ?
    Regards,
    Mike

  • Problem in migrating huge data from mysql to oracle using OMWB.

    I'm using OMWB to migrate my mysql db to oracle db.Mysql db contains some 43 tables and all of them were copied to oracle db except a table "as_db" which contains some 503 mb of data.The table contains 3 columns and two of them were integer type and one is of medium blob.While migrating i'm not getting any error.After migrating i opened the table in the oracle.The table alone created but there were no datas.But all other table contains data.
    Then i generated the ctl file usiing SQL*loader for that particular table alone and tried to execute but it also fails by giving the Column size exceeds for blob.
    How i handle this issue?
    Thanks in Advance,
    Jai.M

    Looks like you may have to save you blobs out as files and load them individually thru the sqlldr process. I know this has normally been done thru raw to blob
    What way is your blob data being saved out in the extract data file.
    Barry

  • Migrating from MySql to Oracle

    Hi,
    I have installed latest version of SQL Developer with new Extensions (added mysql-connector-java-3.1.14-bin.jar under third-party database extension tab) , also installed latest updates from Help Menu. I have created a database in Mysql and now migrating it to Oracle, while I click on Capture MySQL / Quick MySql migrate... i get error "Error ocurred during capture: ORA-01400: cannot insert NULL into ("ASHISH"."MD_PROJECTS"."ID") ".
    Thanks,
    Ashish Sohane.
    OracleDirect.

    I am having the same problem. I have deleted and recreated the repository many times. I'm getting:
    "SQL Error on Script Execution. Try deleting repository before Creating Repository."
    then
    "The Repository installtaion has failed. Please check the user you are registering and make sure that objects of the same name do not already exist"
    I have closed the connection and reopened, closed SQL Developer and reopened. When I expand Tables, there are NO md_ tables. So it seems the repository deletion is working. But when I try to recreate it, oracle somehow thinks the repository I deleted is still there.... even tho it doesn't show it in the ui.
    Although this thread began w/ someone converting from MySQL i think that is probably irrelevant. We are getting the same errors with the oracle repository. I am converting from MSAccess2003 using SqlDeveloper 1.2.1. I have successfully created the XML and SQL exports from MSAccess using SqlDeveloper\Migration\MicrosoftAccess Exporter\2003

  • "Default " problem while migrating from mysql to oracle.

    I'm migrating from mysql3.23 to oracle9i via the OMWB tool.While migrating i'm getting an error message "Failed to create default for the table <table>:ora00907 missing right parenthesis".This error is due to the difference in the syntax used for the keyword "default" in mysql and oracle.In mysql we have to give after the Not Null option whereas in oracle we have to give before Not Null.
    The problem is i'm migrating via the OWMB tool.Is is possible to handle this error with the help of tool itself.
    Thanks
    Jai.M

    Jai, I'm having Frank have a look at this for you to see if we can replicate it ans help solve this issue for you. are there any issues logged on the mysql site regarding saving blobs as file?
    thanks
    Barry

  • Migrating from MySQL to Oracle 11gR2 containing accented characters

    Hello Gurus,
    I am going to migrate a MySQL database that contains accented characters. The collation of the tables holding these data is utf8_unicode_ci.
    I used SQLDeveloper to generate data migration scripts. After a test migration run, the web pages displays "?" instead of the accented character.
    I am currently tracing where the problem is.
    From what I have read, mysqldump uses utf8 as the default character set, so I assume the accented characters in <tablename>.txt files are in tact.
    Could the problem be on sqlldr? Has anyone come across this problem?
    I really would appreciate any help.
    Thanks

    Hi Srini, thanks for the reply.
    here is the result of select * from nls_database_parameters;
    PARAMETER VALUE
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    NLS_CHARACTERSET AL32UTF8
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY $
    NLS_COMP BINARY
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CONV_EXCP FALSE
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_RDBMS_VERSION 11.2.0.1.0

  • Migration from MySQL - connection problem

    I've just installed OMWB 1.3.1 for WINDOWS and created repository in ORACLE 8.0.5 DB.
    When I enter Source Database Details in Capture Wizard and push Next button nothing is happened. In OMWB log-file I've found the following message among many others:
    Exception occurred during event dispatching:
    java.lang.NoClassDefFoundError: org/gjt/mm/mysql/Driver
    at java.util.Vector.<init>(Vector.java:128)
    The directory C:\Oracle\oracle81\Omwb\drivers\
    is empty while in CLASSPATH env variable I've found the following item:
    C:\Oracle\oracle81\Omwb\drivers\mm.mysql.jdbc-1.2a
    If anybody could help me to solve this problem, please let me know.
    Thank you in advance.
    null

    Hi Vladimir,
    I send you a message from the Migration Workbench team that solved my problem. I hope this will resolve yours too.
    Bye,
    Pierfrancesco
    Hi Pierfrancesco
    MySQL 3.22, 3.23 Requirements
    In order to migrate from MySQL to Oracle, you must install the MM MySQL JDBC
    driver release 1.2a on the same system as the Migration Workbench. You can
    obtain this by downloading the MM MySQL JDBC driver from the WorldServer Web
    site at:
    http://www.worldserver.com/mm.mysql
    Copy and unzip the mm.mysql.jdbc-1.2a.zip file to your
    %ORACLE_HOME%\Omwb\drivers directory. This automatically creates a new
    directory called
    mm.mysql.jdbc-1.2a within the drivers directory.
    Can you please verify that you have this driver extracted to the above
    specified directory. Another check you can do is see whether all the files in
    the zip
    have extracted.
    Please refer to the Release notes which you have access to by selection the Help
    drop down menu in the Workbench.
    I hope this helps
    Best regards
    Oracle Migration Workbench Support
    null

  • Whether using Oracle after migrating from MySQL be easy or not?

    Though oracle is tough secured one, I don't know exactly the complexity of using Oracle database. Using MySQL 4.1.22 in my website https://www.puntercalls.com/ . Though the site is based on providing share market tips, it deals with a huge amount of stock market data and in much more real time basis hand-to-hand with NSE and BSE info which means a tough security is the utmost demand of the time.
    My question is whether using Oracle after migrating from MySQL be easy or not. You can check my site at https://www.puntercalls.com/ for different real time data updation parts.
    Kind suggestions are greatly appreciated in advance!
    Edited by: 968684 on Oct 31, 2012 7:04 AM

    Hi,
    As you are really asking about how to setup and use securioty features in an Oracle database it woul db ebetter to raise the question in this forum -
    Forum: Database Security - General
    Database Security - General
    They will have more knowledge about Oracle security features and which it would be best for you to use.
    Regards,
    Mike

  • Problems while migrating from mySql DB to oracle DB

    Hi All,
    I'm using sql developer tool to migrate from MySql DB to oracle DB. I followed the below steps.
    1) I've created oracle and mysql connections successfully.
    2) I've captured Mysql data and I'm able to see the captured model in ' Captured Models ' window. After that right clicked on the captured model and selected ' Set Data Mapping'. Selected ' apply ' button without changing anything. After that I've right clicked on the captured model and selected ' Convert to Oracle Model ' . It has shown the converting process. After some time it has shown conversion completed successfully.
    But converted model is not visible in ' Converted Models ' window.
    Can anyone kindly assist on how to migrate from MySql Db to Oracle DB?
    Thanks,
    Saty.

    Hi,
    We did mysql to oracle migration some time back and played with workbench tool and many other softwares available.
    However our experience was not so good with these tools, each tool had its own limitation and was not able to migrate 100% data. Even the speed of migration was too slow which would have violated our production SLAs.
    So after spending a month with these tools we finally decided to create our own scripts for data migration. We used tools like TOAD and SQL Yok to create the DDL for the tables and other DB objects.
    For the data migration we downloaded the mysql data in flat files and used sql loader to upload the same data in oracle. Even if this was a time consuming activity but this resulted in 100% data migration with no record getting failed and the time taken for this activity was around 6 Hrs in comparison to time of 24-28 Hrs that the workbench tool took.
    Amar

  • Migrating from Sybase to Oracle

    Hi!
    Can someone tell me, how to migrate from Sybase to Oracle.
    Thank U.

    Hi,
    You don't say if you have used the SQL*Developer migration workbench for the migration so far.
    This has a feature for transferring data offline which should do what you want.
    Have a look at the documentation linked from -
    http://www.oracle.com/technology/tech/migration//workbench/index_sqldev_omwb.html
    or at -
    http://download.oracle.com/docs/cd/E12151_01/index.htm
    SQL Developer User's Guide - section 2.9.1 Transferring the Data Offline
    Regards,
    Mike

  • Migration from MySql to Derby

    I am currently migrating from MySql to Derby.
    I have been developing a MRPII package for a while now and whilst my classes worked with MySql I am finding difficulty with implementing them using Derby.
    I have developed a GUI interface for MRPII functions and use a Database Interface class to connect to the database.
    The Database Interface class gives me the capability of reading and writing from a database.
    I extend this capability to sub classes ie part, customers, suppliers, work orders.
    The problem I have is with the ' "+standardCost+" ' type statements. In MySql, the database engine recognises that the standard cost variable is a double though using Derby I get the following Errors.
    SQL Exception: Columns of type 'DOUBLE' cannot hold values of type 'CHAR'. In Save Data error code30000
    SQL Exception: Columns of type 'DOUBLE' cannot hold values of type 'CHAR'. In Save Data error code30000
    Executed statement INSERT INTO stock VALUES('BUDGET500','A1', '100.0','50.0','1.0','100.0')
    Executed statement INSERT INTO part VALUES('BUDGET500', 'PENTIUM','76.0', '86.0','EACH','MP','7','33')
    The only solution I see is giving each subclass of Database Interface the individual capability within that class to connect to the database and use prepared statements.
    Does anyone know if Derby has the capability of processing the updates using a similar format as shown in my code.
    package delta.databaseInterface;
    import delta.databaseInterface.DatabaseInterface;
    public class Part extends DatabaseInterface{
         private String partNumber;
         private String partType;
         private String description;
         private double standardCost;
         private double sellingPrice;
         private String stockLocation;
         private double quantityOnHand;
         private String unitOfMeasure;
         private double minimumStock;
         private double minimumOrderQuantity;
         private int leadTime;
         private double avaliableStock;
                         private int commodityCode;
         public void setPartNumber(String pn){
              this.partNumber = pn.toUpperCase();
         public void setDescription(String ds){
              this.description = ds.toUpperCase();
         public void setStandardCost(double sc){
              this.standardCost = sc;
         public void setSellingPrice(double sp){
              this.sellingPrice = sp;
         public void setQuantityOnHand(double qt){
              this.quantityOnHand = qt;
              this.avaliableStock = qt;
         public void setStockLocation(String sl){
              this.stockLocation = sl.toUpperCase();
         public void setUnitOfMeasure(String uom){
              this.unitOfMeasure = uom.toUpperCase();
         public void setTypeOfPart(String top){
              this.partType = top.toUpperCase();
         public void setMinimumStock(double ms){
              this.minimumStock= ms;
         public void setMinimumOrderQuantity(double moq){
              this.minimumOrderQuantity = moq;
         public void setLeadTime(int lt){
              this.leadTime = lt;
                         public void setCommodityCode(int cc){
              this.commodityCode = cc;
         public void insertIntoPartDatabase(){
           super.setDatabase("mrpii");
                           super.setUpdate( "INSERT INTO part VALUES('"+partNumber+"', '"+description+"','"+standardCost+"'," +
           " '"+sellingPrice+"','"+unitOfMeasure+"','"+partType+"','"+leadTime+"','"+commodityCode+"')");
                             super.saveData();       
         public void insertIntoStockDatabase(){
            super.setDatabase("mrpii");
            super.setUpdate("INSERT INTO stock VALUES('"+partNumber+"','"+stockLocation+"',"+
    " '"+quantityOnHand+"','"+minimumStock+"','"+minimumOrderQuantity+"','"+avaliableStock+"')");
                    super.saveData();
         public void changePartDetails(){
            super.setDatabase("mrpii");
            super.setUpdate( "UPDATE part SET description = '"+description+"',unitOfMeasure = '"+unitOfMeasure+"',"+
              "partType = '"+partType+"' WHERE partNumber = '"+partNumber+"' ");
            super.saveData();
         public void adjustStock(){
              super.setDatabase("mrpii");
              super.setUpdate( "UPDATE stock SET stockLocation = '"+stockLocation+"',"+
              "avaliableStock = (('"+quantityOnHand+"' - qtyOnHand ) + avaliableStock), "+
              " qtyOnHand = '"+quantityOnHand+"' WHERE partNumber = '"+partNumber+"' ");
              super.saveData();
         public void insertAllocation(String allocationID, double quantity){
              super.setDatabase("mrpii");
              super.setQuery("INSERT INTO allocations VALUES('"+partNumber+"','"+quantity+"',"+
                 " '"+allocationID+"')");
              super.saveData();
         public void reduceAvaliable(double allocated){
              super.setDatabase("mrpii");
              super.setUpdate( "UPDATE stock SET avaliableStock = (avaliableStock - '"+allocated+"') WHERE " +
              "partNumber = '"+partNumber+"' ");
              super.saveData();
         public void increaseAvaliable(double allocated){
              super.setDatabase("mrpii");
              super.setUpdate( "UPDATE stock SET avaliableStock = (avaliableStock - '"+allocated+"') WHERE " +
              "partNumber = '"+partNumber+"' ");
              super.saveData();
    }Any help would be deeply appreciated
    Thanks
    Jim

    I am currently migrating from MySql to Derby. Dear God, why?I am using the embedded functionality.
    >
    I have been developing a MRPII package for a whilenow
    MRP as in "manufacturing resource planning"?Yes
    >
    and whilst my classes worked with MySql I am
    finding difficulty with implementing them using
    Derby.That suggests that your Java code relies too heavily
    on MySQL features. You didn't make your code
    portable enough.
    I have developed a GUI interface for MRPIIfunctions
    and use a Database Interface class to connect tothe
    database.
    The Database Interface class gives me thecapability
    of reading and writing from a database.
    I extend this capability to sub classes ie part,
    customers, suppliers, work orders.
    The problem I have is with the ' "+standardCost+"'
    type statements. In MySql, the database engine
    recognises that the standard cost variable is a
    double though using Derby I get the following
    Errors.Right - you're counting on something that might not
    be true for all databases. MySQL appears to be doing
    an implicit conversion from string to double. Bad
    idea.
    SQL Exception: Columns of type 'DOUBLE' cannothold
    values of type 'CHAR'. In Save Data errorcode30000
    SQL Exception: Columns of type 'DOUBLE' cannothold
    values of type 'CHAR'. In Save Data errorcode30000
    Executed statement INSERT INTO stock
    VALUES('BUDGET500','A1',
    '100.0','50.0','1.0','100.0')
    Executed statement INSERT INTO part
    VALUES('BUDGET500', 'PENTIUM','76.0',
    '86.0','EACH','MP','7','33')Do you use PreparedStatements to escape strings and
    dates for you? If not, you're in for a bumpy ride.
    The only solution I see is giving each subclass of
    Database Interface the individual capabilitywithin
    that class to connect to the database and use
    prepared statements.I would not have a single database interface. Each
    class has its own requirements. How can a single
    class know about all of them? Better to break your
    persistence layer into several interaces, one per
    persistent class.That is what I thought
    >
    Does anyone know if Derby has the capability of
    processing the updates using a similar format as
    shown in my code.I think your code is in trouble, Jim.Probably so, thought a redesign is not so much of a problem now as I am a bit more experienced than when I started out.
    >
    You don't use prepared statements, which would help
    with your portability issues.
    You have SQL embedded in the objects. I'd move it
    out into a separate persistence layer.
    You might want to read about Hibernate, an
    object/relational mapping layer. You've got objects
    and tables. Hibernate tools or Middlegen can
    generate the XML mapping files for you. Once you
    have those, you'll find that Hibernate will make
    porting to another database a lot easier. It can be
    as easy as changing configuration files.
    I'd also look into Spring. It has some great
    plumbing to help you deal with databases and lots of
    other stuff.
    %My main class is as follows;
    package delta.databaseInterface;
    * @author James Charles
    import java.sql.SQLException;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;
    import java.util.Vector;
    import javax.swing.JTable;
    public class DatabaseInterface{
         private String database;
         private String query;
                         private String update;
                private String[][] results = new String[0][0];
         private int columnCount = 0;
         private int rowCount = 0;
         private boolean resultsExist = false;
         Object data[][];
         private JTable table;
         public void setDatabase(String database){
              this.database = database;
         public void setQuery(String query){
              this.query = query;
                public void setUpdate(String update){
              this.update= update;
            public void saveData(){
              try{
              Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
              String sourceURL = new String("jdbc:derby:" + this.database);
              Connection databaseConnection = DriverManager.getConnection(sourceURL);
              Statement statement = databaseConnection.createStatement();
              statement. executeUpdate(this.update);
                    databaseConnection.close();
              } // end of try
              catch(ClassNotFoundException cnfe){
                   System.err.println(cnfe);
              catch(SQLException sqle){
                   System.err.println(sqle + " In Save Data error code" + sqle.getErrorCode());
                             System.out.println("Executed statement " + this.query);
                    catch(InstantiationException ie){
                        System.err.println(ie);
             catch(IllegalAccessException iae){
                        System.err.println(iae);
         public String getDatabase(){
              return this.database;
         public String getQuery(){
              return this.query;
         public void setResults(){           
         try{
              Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
              String sourceURL = new String("jdbc:derby:" + this.database);
              Connection databaseConnection = DriverManager.getConnection(sourceURL);
              Statement statement = databaseConnection.createStatement();
              ResultSet thisResult = statement.executeQuery(this.query);
                    databaseConnection.commit();
              System.out.println("Executed statement");
              convertToArray(thisResult);
              databaseConnection.close();
         } // end of try
         catch(ClassNotFoundException cnfe){
              System.err.println(cnfe);
         catch(SQLException sqle){
              System.err.println(sqle);
         catch(InstantiationException ie){
                        System.err.println(ie);
             catch(IllegalAccessException iae){
                        System.err.println(iae);
         public void convertToArray(ResultSet resultsIn) throws SQLException{
              this.resultsExist = false;
              String[] columnNames = new String[0];
              Vector dataRows = new Vector();
              ResultSetMetaData metadata = resultsIn.getMetaData();
              this.columnCount = metadata.getColumnCount();
              columnNames = new String[this.columnCount];
              for(int i = 0; i < this.columnCount; i++)
                   columnNames[i] = metadata.getColumnLabel(i+1);
              String[] rowData = new String[this.columnCount]; // Stores one row
              while(resultsIn.next()){ // For each row...
                   rowData = new String[this.columnCount]; // create array to hold thedata
                        for(int i = 0; i < this.columnCount; i++)// For each column
                        rowData[i] = resultsIn.getString(i+1); // retrieve the data item
                        dataRows.addElement(rowData); // Store the row in the vector
              this.results= new String[dataRows.size()][this.columnCount];
              this.data= new Object[dataRows.size()][this.columnCount];
              for(int column = 0; column < this.columnCount; column++)
                   for(int row = 0; row < dataRows.size(); row++){
              this.results[row][column] = ((String[])(dataRows.elementAt(row)))[column];
              this.data[row][column] = ((String[])(dataRows.elementAt(row)))[column];
              this.rowCount = dataRows.size();
              try{
                   if  (results[0][0].equals(null)){ this.resultsExist = false;} //ckecks results
                        else {this.resultsExist = true;}
                   catch (ArrayIndexOutOfBoundsException e){
                   System.out.println(e + "in catch");
                   this.resultsExist = false;
                   System.out.println("Value of exists in catch = " + this.resultsExist);
         }// end of set results
         public JTable getTable(Object[] columnNames) {
              table = new JTable(data, columnNames);
              return table;
         public int getColumnCount(){
              return this.columnCount;
         public int getRowCount(){
              return this.rowCount;
         public String getData(int row, int column){
              return this.results[row][column];
         public boolean doResultsExist(){
              return this.resultsExist;
    } // end of database InterfaceI developed this code about a year ago and maybe it is time to simplify it.
    With MySql I could create an instance of Database Interface or use one of its subclasses and perform any function on the database by calling its methods.
    maybe it is time for a redesign!
    thanks
    jim

Maybe you are looking for

  • I have a ringtone in iTunes, but can't get it to "sounds" file

    I have a ringtone in iTunes, but can't get it to "sounds" file

  • Interacting with perl through java.

    I'm trying to do something with Java that I haven't managed to do until now. I'm trying to interact with a perl process giving him input and reading output. I have a perl module that has several functions and the idea is to launch a process in a java

  • Dates receiving email has changed from today's date to thirty years ago

    Hello, starting receiving emails from a government department yesterday (11/12/2014) and these are dated 1/01/1970. Can anyone help me with this? All other emails from various other sources are dated correctly.

  • Deski reports performance issue

    After an upgrade from BOXI Release2-SP3 to BOXI Release3.1-SP3 all the deski reports are very slow when we try to refresh them using Infoview. For example, a specific deski report needs two minutes from Desktop Intelligence and twenty!!! minutes from

  • XI - SRM : info on RFQ

    Hello Guyz!... I am trying to develop an interface in XI to post 'Request For Quotation' into SRM system. Can anybody help me on this.. Any kind of help is greatly appreciated. Thanks in Advance.