Select DBASE IV data from Oracle on Linux

Can I select DBASE IV data from Oracle on Linux

You can connect to DBase IV from Oracle by configuring Oracle Heterogenous Services. That will let you create a database link from Oracle to a non-Oracle database. Since there isn't a specific DBASE IV gateway, though, I believe you'll have to use the ODBC gateway, which would probably imply the necessity of a Windows box hosting Heterogenous Services.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC

Similar Messages

  • Select DBase (.dbf) data from Oracle on Linux

    How to select DBase (.dbf) data from Oracle on Linux ?
    dbf files connected to Linux form NetWare server as 'ncpmount'.
    Oracle has access as oracle 'Directory' object.

    If you have an ODBC driver for it and are using Oracle 10g you can use Generic Connectivity. For more information on Generic Connectivity refer to the Chap 7 of the Heterogeneous Connectivity Administrator's Guide.
    http://download-west.oracle.com/docs/cd/B13789_01/server.101/b10764/gencon.htm#1005900

  • Exporting Data From Oracle 10g to Access

    Hi Experts,
    I need to export data from oracle apps shcema(each and every object in it) to MS ACCESS File.
    Please let me know how to do it
    Thanks and Regards,
    Andy

    Since you did not provide details of what you are planning to do, a very simple, however, depending upon the number of your tables, very labour intensive solution:
    Although being not very familiar with access, I think access offers a means to import csv files.
    So e.g. using SQL*Plus you can execute the following steps.
    set pagesize <nnn>
    set linesize <nnn>
    set colsep ',' -- You may choose other special characters to separate columns of your output
    spool <csv-file>
    select * from <tab>;
    spool offWherever you see <nnn> exchange by appropriate numeric values to get just one page as result and to configure your line size to hold a complete record in one output line.
    Replace <csv-file> and <tab> by the name of your output file to be read in to access and by the name of your table, respectively.

  • Using FDM to load data from oracle table (Integration Import Script)

    Hi,
    I am using Integration Import Script to load data from oracle table to worktables in FDM.
    i am getting following error while running the script.
    Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done
    Attaching the full error report
    ERROR:
    Code............................................. -2147217887
    Description...................................... Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
    At line: 22
    Procedure........................................ clsImpProcessMgr.fLoadAndProcessFile
    Component........................................ upsWObjectsDM
    Version.......................................... 1112
    Thread........................................... 6260
    IDENTIFICATION:
    User............................................. ******
    Computer Name.................................... *******
    App Name......................................... FDMAPP
    Client App....................................... WebClient
    CONNECTION:
    Provider......................................... ORAOLEDB.ORACLE
    Data Server......................................
    Database Name.................................... DBNAME
    Trusted Connect.................................. False
    Connect Status.. Connection Open
    GLOBALS:
    Location......................................... SCRTEST
    Location ID...................................... 750
    Location Seg..................................... 4
    Category......................................... FDM ACTUAL
    Category ID...................................... 13
    Period........................................... Jun - 2011
    Period ID........................................ 6/30/2011
    POV Local........................................ True
    Language......................................... 1033
    User Level....................................... 1
    All Partitions................................... True
    Is Auditor....................................... False
    I am using the following script
    Function ImpScrTest(strLoc, lngCatKey, dblPerKey, strWorkTableName)
    'Oracle Hyperion FDM Integration Import Script:
    'Created By:     Dhananjay
    'Date Created:     1/17/2012 10:29:53 AM
    'Purpose:A test script to import data from Oracle EBS tables
    Dim cnSS 'ADODB.Connection
    Dim strSQL 'SQL string
    Dim rs 'Recordset
    Dim rsAppend 'tTB table append rs object
    'Initialize objects
    Set cnSS = CreateObject("ADODB.Connection")
    Set rs = CreateObject("ADODB.Recordset")
    Set rsAppend = DW.DataAccess.farsTable(strWorkTableName)
    'Connect to SQL Server database
    cnss.open "Provider=OraOLEDB.Oracle.1;Data Source= +server+;Initial Catalog= +catalog+;User ID= +uid+;Password= +pass+"
    'Create query string
    strSQL = "Select AMOUNT,DESCRIPTION,ACCOUNT,ENTITY FROM +catalog+.TEST_TMP"
    'Get data
    rs.Open strSQL, cnSS
    'Check for data
    If rs.bof And rs.eof Then
    RES.PlngActionType = 2
    RES.PstrActionValue = "No Records to load!"
    Exit Function
    End If
    'Loop through records and append to tTB table in location’s DB
    If Not rs.bof And Not rs.eof Then
    Do While Not rs.eof
    rsAppend.AddNew
    rsAppend.Fields("PartitionKey") = RES.PlngLocKey
    rsAppend.Fields("CatKey") = RES.PlngCatKey
    rsAppend.Fields("PeriodKey") = RES.PdtePerKey
    rsAppend.Fields("DataView") = "YTD"
    rsAppend.Fields("CalcAcctType") = 9
    rsAppend.Fields("Amount") = rs.fields("Amount").Value
    rsAppend.Fields("Desc1") = rs.fields("Description").Value
    rsAppend.Fields("Account") = rs.fields("Account").Value
    rsAppend.Fields("Entity") = rs.fields("Entity").Value
    rsAppend.Update
    rs.movenext
    Loop
    End If
    'Records loaded
    RES.PlngActionType = 6
    RES.PstrActionValue = "Import successful!"
    'Assign Return value
    SQLIntegration = True
    End Function
    Please help me on this
    Thanks,
    Dhananjay
    Edited by: DBS on Feb 9, 2012 10:21 PM

    Hi,
    I found the problem.It was because of the connection string.The format was different for oracle tables.
    PFB the format
    *cnss.open"Provider=OraOLEDB.Oracle.1;Data Source= servername:port/SID;Database= DB;User Id=aaaa;Password=aaaa;"*
    And thanks *SH* for quick response.
    So closing the thread......
    Thanks,
    Dhananjay

  • How to copy the Data From Oracle Table To SAP Table

    Hi Friends,
    We need to copy the data from Oracle Database Table to SAP Table. The data should be updated simultaneously in both tables . Should I write a program that contains the native sql statement like EXEC SQL PERFORMING WRITE,....
    I appreciate any suggestions regarding this.
    Regards
    CSM Reddy

    Hi,
    since you posted this question in the DB2 forum I assume that you are using a DB2 database for your SAP system.
    To access a table from a legacy ORACLE database you may use the DBSL multiconnect feature. I.e. you open a secondary connecction in the SAP system to your ORALE database. You can then ready the data from the ORACLE database into an ABAP internal table and insert it afterwards into the DB2 table on the main connection.
    Another way to access an ORACLE table from a DB2 database is to use the DB2 federated database feature. This requires a little bit more DB2 skill. With this feature you can make the ORACLE table visible within the DB2 database. To copy data you can then simply use a "INSERT ... SELECT" statement. 
    Regards
             Frank

  • Query Data From Oracle to Excel

    Dear all,
    Please guide me to solve.
    Regards
    Dharma

    Question's Caption is : Data From Oracle to Excel
    While you are asking :
    data in execel (windows ) move to Oracle Database table (Linux *64)Anyway, if your question is export data from Excel to Oracle then below thread may be of your interest which are saying that you have to install Dg4ODBC on Windows and use the ODBC driver there.
    When running DG4ODBC on Unix you need an ODBC driver on this Unix box which can connect to the MS Excel file. I'm not aware of any suitable driver so far that fulfills the ODBC level 3 standard required for DG4ODBC.
    So instead of using DG4ODBC, get the Windows software of DG4ODBC and install it on a Windows machine. You can then connect from your Oracle database to the Dg4ODBC listener on Windows which then spawns the DG4ODBC process. This DG4ODBC process then uses the MS Excel ODBC driver to connect to the Excel sheet.
    https://cn.forums.oracle.com/forums/thread.jspa?messageID=10466197
    For this purpose there is separate forum too : [url https://forums.oracle.com/forums/forum.jspa?forumID=63] Heterogeneous Connectivity
    Regards
    Girish Sharma

  • Extract of Data from Oracle in a Flat File with Column and Record seperator

    I have a case where I have to extract whole data froma Oracle Table where the Columns should be seperated by |@|
    and Records by ^*^.
    The reason for this is My data has Space and New line in it. So My Program to recoganize each column and record I want them to be seperated by special chars.
    Itried this but of no much help.
    set echo off newpage 0 space 0 pagesize 0 feed off head off trimspool on;
    spool on;
    set colsep '|@|';
    set recsepchar '^*^';
    spool "T_COMPLAINT.dat";
    select * from T_COMPLAINT where ROWNUM < '100' order by cptoid;
    spool off;

    Having '@' and '*' characters in the data will not make any difference if you are using a combined column separator of '|@|' - provided any process you use subsequently can handle it.
    However, the recsepchar parameter appears to be restricted to a single character which is repeated right across the page, so I don't think you could have a single iteration of '|*|' using this method:
    SQL> set  newpage 0 space 0 pagesize 0 feed off head off trimspool on
    SQL> set recsep EACH
    SQL> set recsepchar '*'
    SQL> set colsep '|@|'
    SQL> select * from testa;
    A         |@|1@        |@|22-JUN-2010
    B         |@|2*        |@|22-JUN-2010
    B         |@|2*        |@|22-JUN-2010
    ********************************************************************************Edited by: LindaA on 23-Jun-2010 08:33

  • Extract data from Oracle in excel file

    Hi,
    I have a requirement where in I need to extract data from Oracle in excel file and the excel worksheet name should be "Data".
    for eg. excel file name "AR Data_DDMMYY" and excel worksheet name "Data"
    I have used the UTL_FILE API to extract the tab delimited data which can be opened in excel but it is not exactly an excel file as the worksheet name is same as the file name.
    I tried using utl_file.fcopy and frename.
    Is there any way to do this using PLSQL?
    select * from v$version;
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    PL/SQL Release 10.2.0.5.0 - Production
    "CORE     10.2.0.5.0     Production"
    TNS for HPUX: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - ProductionSample Code:
    declare
    cursor c is
    select * from scott.emp;
    v varchar2(100);
    f utl_file.file_type;
    file_name varchar2(100) := 'AR Data.xls';
    dir varchar2(50) := 'CESDIR191710';
    --select * from dba_directories
    begin
    f := utl_file.fopen(dir, file_name, 'W');
    v := 'EMPNO'||chr(9)||'ENAME'||chr(9)||'JOB'||chr(9)||'SAL'||chr(9)||'HIREDATE'||chr(9)||'DEPTNO';
    utl_file.put_line(f, v);
    for i in c
    loop
    v := i.empno||chr(9)||i.ename||chr(9)||i.job||chr(9)||i.sal||chr(9)||i.hiredate||chr(9)||i.deptno;
    utl_file.put_line(f, v);
    end loop;
    utl_file.fclose(f);
    --utl_file.frename(dir, file_name, dir, replace(file_name, '.xls', '_')||to_char(sysdate, 'MMDDYY')||'.xls', false);
    utl_file.fcopy(dir, file_name, dir, replace(file_name, '.xls', '_')||to_char(sysdate, 'MMDDYY')||'.xls');
    end;Thanks
    Imran

    Imran Soudagar wrote:
    Hi,
    I was able to generate the excel 2007 file with the data using the package from below link;
    http://technology.amis.nl/2011/02/19/create-an-excel-file-with-plsql/
    but the requirement is to generate excel 2003 file.
    I tried changing the .xlsx to .xls and it gives a note while opening the file "The file you are trying to open, abc.xls, is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?"Then you have three options:
    1) stop using anton's package and find another one that supports the old and deprecated version of Excel 2003
    2) write your own package to produce an Excel file.
    3) Upgrade your version of Excel to a recent version
    I tried the programs from other links on the forum but I am still getting this message. The client does not want this message to be displayed as the excel file works as an input to another system.
    Can anyone help me with the issue?
    Also, is it true that the programatically generated excel file is actually an xml file which is renamed to .xls and hence it shows the message while opening such files?Yes, Excel supports several different formats for it's files. By default, if you save an XLS files from Excel, it writes it out in a Microsoft proprietary binary format, which you would be hard pushed to replicate easily from PL/SQL. Excel also has the ability to save it's files as XML format, which is more readable and easier to produce programatically, whilst still allowing you to have multiple sheets, formulas and formatting included in it. That's the format that most people who need formatting and multiple sheets opt for when programatically generating their data as excel workbooks. (There's also an SLYK format that people used to use before that, but it's not as flexible)
    If you want to write your own, the easiest thing to do is to start with a blank workbook in Excel, and put in your basic requirements e.g. a couple of named sheets, and some data in different formats (number, date, text etc.) and different formatting options etc. Save that file in XML format from Excel and then open up the file using notepad/wordpad to look at the structure. There'll be a whole load of redundant rubbish Microsoft put in there, but you should be able to figure out the basic structure of XML required to give you what you want.

  • Walkthrough: Displaying Data from Oracle database in a Windows application.

    This article is intended to illustrate one of the most common business scenarios such as displaying data from Oracle database on a form in a Windows application using DataSet objects and .NET Framework Data Provider for Oracle.
    You can read more at http://www.c-sharpcorner.com/UploadFile/john_charles/WalkthroughDisplayingDataOracleWindowsapplication05242007142059PM/WalkthroughDisplayingDataOracleWindowsapplication.aspx
    Enjoy my article.

    hi,
    this is the code :
    public class TableBean {
    Connection con ;
    Statement ps;
    ResultSet rs;
    private List perInfoAll = new ArrayList();
    public List getperInfoAll() {
    int i = 0;
    try
    con = DriverManager.getConnection("url","root","root");
    ps = con.createStatement();
    rs = ps.executeQuery("select * from user");
    while(rs.next()){
    System.out.println(rs.getString(1));
    perInfoAll.add(i,new perInfo(rs.getString(1),rs.getString(2),rs.getString(3)));
    i++;
    catch (Exception e)
    System.out.println("Error Data : " + e.getMessage());
    return perInfoAll;
    public class perInfo {
    String uname;
    String firstName;
    String lastName;
    public perInfo(String firstName,String lastName,String uname) {
    this.uname = uname;
    this.firstName = firstName;
    this.lastName = lastName;
    public String getUname() {
    return uname;
    public String getFirstName() {
    return firstName;
    public String getLastName() {
    return lastName;
    ADF table code:
    <af:table value="#{tableBean.perInfoAll}" var="row"
    binding="#{backing_Display.table1}" id="table1">
    <af:column sortable="false" headerText=""
    align="start">
    <af:outputText value="#{row.firstName"/>//---> Jdeveloper 11g doesn't allow me to use this.. it says firstName is an unknown property..
    </af:column>
    </af:table>
    Please tell me is this the way to do it.. or is it a must to use the DataCollection from the data controls panel...
    Thanks...

  • Insert data from oracle  to sql server

    we have running R12.1.1 .
    our company wants to deploy some CRM Application with sql server database. Continuously we have to insert data ( some fields from some tables of Order Management module ) from ORACLE -----------> SQL Server
    My Questions are :
    1. What are possible methods to insert data from ORACLE -----------------> SQL Server ?
    2. What are pros and cons of each method ?
    3. What is performance over load of each method ?
    PLease share your valuable knowledge / ideas / suggestions
    thanks

    What is a maximal latency for data changed in Oracle come into MS SQL?
    this data will be updated in CRM after 24 hours.Does it mean that data replicated from Oracle will be updated in MS SQL and should be replicated back?
    i want to know more details about these APIs etc and middle layer.what API? In MS SQL you can use Linked server and write SQLs that select from Oracle tables via that linked server and insert/update/delete into MS SQL. You can organize these SQLs into T-SQL procedures and run them in jobs.
    Also you can use MS SQL replication, snapshot or transactional, which is ugly because it places triggers on Oracle tables. I doubt that this will be approved by app vendor.
    Also you can use Oracle Streams via Transparent Gateway for MS SQL, which will be quite heavy solution.
    Also, if real-time replication is needed, you can use "middle layer" Oracle Golden Gate, which may be quite pricy for 30 tables.
    Also, if real-time replication is needed, you can use 3-rd party middle layer like DataCurrents or others.

  • Send encrypted data from oracle 11g to Ms SQL Server 12

    Hi every body,
    we want to send encrypted data from oracle 11g to Ms SQL Server 12:
    - data are encrypted to oracle
    - data should be sent encrypted to Ms SQL server
    - data will be decrypted in Ms SQL server by sensitive users.
    How can we do this senario, any one has contact simlare senario?
    can we use asymetric encription to do this senario?
    Please Help!!
    Thanks in advance.

    Hi,
      What you want to do about copying data from Oracle to SQL*Server using insert will work with the 12c gateway.  There was a problem trying to do this using the 11.2 gateway but it should be fixed with the 12c gateway.
    If 'insert' doesn't work then you can use the SQLPLUS 'copy' command, for example -
    SQL> COPY FROM SCOTT/TIGER@ORACLEDB -
    INSERT SCOTT.EMP@MSQL -
    USING SELECT * FROM EMP
    There is further information in this note available on My Oracle Support -
    Copying Data Between an Oracle Database and Non-Oracle Foreign Data Stores or Databases Using Gateways (Doc ID 171790.1)
    However, if the data is encrypted already in the Oracle database then it will be sent in the encrypted format. The gateway cannot decrypt the data before it is sent to SQL*Server.
    There is no specific documentation about the gateways and TDE.  TDE encrypts the data as it is in the Oracle database but I doubt that SQL*Server will be able to de-encrypt the Oracle data if it is passed in encrypted format and as far as I know it is not designed to be used for non-Oracle databases.
    The Gateway encrypts data as it is sent across the network for security but doesn't encrypt the data at source in the same way as TDE does.
    Regards,
    Mike

  • Pull the data from ORACLE

    Hi Guru's,
    I would like to know ,How to pull the Data from Oracle tables to BW.
    tell me scratch onwards...
    regards
    sekhar ch

    Hi...
    In the admin workbench open the modeling tab and select Source Systems
    In the right pane, right-click on Source Systems and select Create…
    A dialog requires you to define the type of source system. Select “Database System”
    Enter a description for the source system
    Once you accept the definition of the source system, you have to provide the following information, save and back out:
    DBMS: ORA (Oracle)
    User Name: Your UID
    DB password: Your pwd
    Conn. Info: sql*net string
    Select “Permanent connection” if this is the case
    If everything went well, you should see the new source system. When you do a right-click and ask for the DataSource overview, the first time you execute it you will be prompted to generate the application hierarchy
    In order to test connectivity, right-click on the source system and select “Select Database Tables”
    The following screen shows up. Click on the execute button…
    any tables or views that you have access through your UID
    Select a table or view and click on “Edit DataSource”
    To test data retrieval, click on “Display table contents”
    Designate the application component, determine the type of DataSource (Text, Master data, or Transaction data) then generate the DataSource
    with regards,
    hari

  • How can i extract data from oracle table  to flat file or excel spread shee

    Hello,
    DB Version is 10.1.0.3.0
    How can i extract data from oracle table to flat file or excel spread sheet by using sub programs?
    Regards,
    D

    Here what I did
    SET NEWPAGE 0
    SET SPACE 0
    SET LINESIZE 80
    SET PAGESIZE 0
    SET ECHO OFF
    SET FEEDBACK OFF
    SET VERIFY OFF
    SET HEADING OFF
    SET MARKUP HTML OFF SPOOL OFF
    Sql> SPOOL bing
    select * from -------;
    SPOOL OFF;
    I do not see file.
    I also tried
    Sql> SPOOL /tmp/bing
    select * from -------;
    SPOOL OFF;
    But still not seeing the fie,

  • How to Extract Data from Oracle DB ?

    hi,
    I am trying to Extract Data from Oracle DB using DBconnect. and looks like its not working. Not able to connect to Database.
    thanks

    Hi,
    Can you please follw the below steps:
    If you need to load data from an Oracleu2122 database use DB Connect instead of an ETL Tool
    Although limited to full updates, it allows true u201Chands-offu201D automation of data extraction
    Is not limited to Oracleu2122 databases, it supports ALL database systems supported by SAP BW
    DB Connect can read the remote data dictionary, replicate table and views, and transfer metadata into the SAP BW Meta Data Repository.
    1.Begin with your data model
    2.Identify which tables provide:
      Master Data
    Transactional Data
    3.Once the model is complete:
    Obtain a UID and Password from the DBA
    Ensure that table synonyms are not used u2013 they donu2019t work at this point in time (SAP Note # 518241)
    Your UID has to have select permissions on the required database objects.
    4.In the admin workbench open the modeling tab and select Source Systems
    5.In the right pane, right-click on Source Systems and select Createu2026
    6. you have to define the type of source system. Select u201CDatabase Systemu201D
    7.Enter a description for the source system
    8.Once you accept the definition of the source system, you have to provide the following information, save and back out:
    DBMS: ORA (Oracle)
    User Name: Your UID
    DB password: Your pwd
    Conn. Info: sql*net string
    Select u201CPermanent connectionu201D if this is the case
    9.If everything went well, you should see the new source system. When you do a right-click and ask for the DataSource overview, the first time you execute it you will be prompted to generate the application hierarchy. Answer yes to the prompt and then you will be able to see the DataSource tree.
    10.In order to test connectivity, right-click on the source system and select u201CSelect Database Tablesu201D
    11.Click on the execute button.
    12.Next shows up displaying any tables or views that you have access through your UID
    13.Select a table or view and click on u201CEdit DataSourceu201D.
    14.To test data retrieval, click on u201CDisplay table contentsu201D
    15.Designate the application component, determine the type of DataSource (Text, Master data, or Transaction data) then generate the DataSource.
    16.For each applicable table/view generate the repeat steps 13 to 15.
    17.From there, assign the DataSource to each target (InfoObject, InfoProvider) as usual.
    Moving from Dev to QA to Prod:
    18.Before transporting all you configuration work, you will have to manually set up the source system (Steps 4 to 8) in your QA or Prod
    19.Depending on your authorization settings in Production, you may need to implement a system restore. Work with BASIS if you need to, donu2019t do it on your own!
    20.Then transport your InfoObjects, InfoProviders, Update Rules, Transfer Rules, InfoPackages, etc.
    21.If you developed the process chains, transport them separately.
    22.Try to maximize throughput by using parallel processing of master data
    23.Ensure the right sequence for transactional data loads is followe.
    24.Combine the master data loads and the transactional data loads in a master process chain.
    It can be help full.
    Regards,

  • Retrieve specific range data from oracle table

    Hi, Dear friends,
    I want to retrieve all the data from oracle table and then save them to mysql table using JDBC ResultSet. The problem is that some oracle table is too big, if I retrieve all of them to memory at a once time using excuteQuery, the program will become no response out of memory limitation. So my question is if I can retrieve just specific range data once a time. I can¡¯t find this function through JDBC API. Also, I don¡¯t want to use the specific sql sentence, for example ¡°select ¡ from¡ where someid>¡ and someid<¡¡±, because there are many different tables, I want to transfer them automatically. So I can¡¯t construct such sql sentence in advance. Does anyone know if oracle JDBC driver provide such kind of function or does there any other way?
    Any suggestion will be greatly appreciated!
    Sammy

    Dear Justin,
    thank you so much for your prompt reply!
    as your suggestion, I do check the performance while my program is running, after the program become nearly no response, I found the memory usage is nearly 100%, while disk usage and process usage is pretty low. that's the reason why I guess maybe the memory limitation, but the strange thing is that no any error reported by JBuilder, it just nearly no response and don't transfer any data any more. my os is windows xp, the version of JBuilder is 7. my main memory is 768M. just as you said, the total 6,000 records in not very large, just no more than 400K. another strange thing is that why my program works well when there is little data records in the table.
    the big picture of my program is first I retrieve oracle table metadata, according to this information, I construct DDL sql words and then create the corresponding table in mysql database. this part works well. in order to save your time, I will not paste the code here. then there is a method to transfer oracle data to mysql table, whenever creating the mysql table, then I will call this method to transfer datat to it. the following is the code of this method, I am very sorry to take your time. please read it when you are available.
    thank you very much!!
    Sammy
    //transfer data from oracle to mysql!!!
    private static void transferData(Connection oracleConn, Connection mysqlConn, String oracleTableName, String oracleSchemaName) throws SQLException{
    Statement oracleStmt=oracleConn.createStatement();
    Statement mysqlStmt=mysqlConn.createStatement();
    // sending sql to oracle to retrieve data
    String thisTableName=oracleTableName;
    String oracleSQL="SELECT * FROM ".concat(thisTableName);
    ResultSet oracleRS = oracleStmt.executeQuery(oracleSQL);
    String sql="";
    if (oracleRS.next()) {
    ResultSetMetaData rsmd = oracleRS.getMetaData();
    int colCount = rsmd.getColumnCount();
    do {
    String sqlBodyPart="";
    String sqlValuePart="";
    System.out.println("the number of column is "+colCount);
    for (int i = 1; i <= colCount; i++) {
    String columnValue = oracleRS.getString(i);
    boolean b = oracleRS.wasNull();
    String columnName =rsmd.getColumnName(i);
    System.out.println("the value of column " + i + "is " + columnValue);
    //construc the sql body part and value part
    sqlBodyPart=sqlBodyPart.concat(" ").concat(columnName).concat(",");
    if(b){ //if the value of the column i is null
    sqlValuePart=sqlValuePart.concat(" null").concat(",");
    }else{
    sqlValuePart=sqlValuePart.concat(" '").concat(columnValue).concat("',");
    //get rid of the last comma in sqlBodyPart and sqlValuePart
    if(!sqlBodyPart.equalsIgnoreCase("")) sqlBodyPart=sqlBodyPart.substring(0,sqlBodyPart.length()-1);
    if(!sqlValuePart.equalsIgnoreCase("")) sqlValuePart=sqlValuePart.substring(0,sqlValuePart.length()-1);
    //construct the sql sentence!!!
    sql="INSERT INTO ".concat(thisTableName).concat(" (").concat(sqlBodyPart).concat(") ").concat(" VALUES(").concat(sqlValuePart).concat(")");
    System.out.println("the sql words for this column is");
    System.out.println(sql);
    System.out.println(" ");
    if(mysqlStmt!=null){
    int rows = mysqlStmt.executeUpdate(sql);
    } else{
    System.out.println("can't connect with mysql server");
    System.exit(1);
    while (oracleRS.next());
    } else {
    System.out.println("There are no data in the table...");
    }//end of method data transfer!
    //end of method data transfer!

Maybe you are looking for