If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > How to convert oracle 9i database to mysql using JSP?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-24-03, 01:05
samwzm samwzm is offline
Registered User
 
Join Date: Dec 2003
Posts: 2
Red face How to convert oracle 9i database to mysql using JSP?

Dear friends,

I want to convert oracle 9i database to mysql using JSP technology. Does there anyone who have a hint or some web links about this task? I searched the internet and found all of them are not free and no source code. In fact, what I want to do is really simple, I just want to first, reading the oracle database table structure information and then create the exactly same table in mysql, and then copying all the data in oracle database table to mysql table. But I donĄ¯t know how to retrieve the oracle table structure using JDBC. And also I want to retrieve all the tables in the oracle database, so I can choose from them to convert to mysql. It seems that the structure in oracle usually have the tablespace information, I donĄ¯t know if I can create database in mysql using this tablespace information. And I donĄ¯t know where I can find the information about the functions in JDBC? For example, how to retrieve the table structure? Once I retrieve the table structure and create the exactly same table structure in mysql, then I can fetch all the data in oracle table to mysql table.

Any hint will be great appreciated!

Merry Christmas and Happy new year!
Sammy
Reply With Quote
  #2 (permalink)  
Old 01-16-04, 09:18
lluis lluis is offline
Registered User
 
Join Date: Jan 2004
Posts: 2
How to convert oracle 9i database to mysql using JSP?

Hi, one way to do it is to query the object's structure trough SQL using JDBC, then you will have all the information you need available in Recordsets (datatypes, names...)

In Oracle in order to get all tables (or other types of objects) you can:

SELECT Object_Name,Object_ID FROM user_objects WHERE Object_Type='TABLE'

Then you can iterate trough the resulting Recordset and for each table you have gotten on the previous query. get the column structure like this:


SELECT * From user_tab_columns WHERE Table_Name='TableName'


This way you can conditionaly build up Create table statements with proper datatype mappings...


The same method could be used for any type of objects...
Doing the same from Oracle to SQL Server ... a pain in the arse....

Good luck... Lluis.

Last edited by lluis; 01-16-04 at 09:30.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On