Using DB2's import/export utilities in Java program

DB2 database has build in utility called export, throgh which we can export the output of a Query directly onto a Lotus 123 file. But I beleive that , to invoke such DB2 utilities throgh a Java Program, we need to have APIs.
My question is ,are such APIs available ?
If so, what are the APIs necessary for calling this EXPORT and IMPORT utilities of DB2 ?

Well, If you have to use Runtime.exec() and provide these as command lines, then the best option is to write a shell script( my Java application is on AIX platform) and then call the shell script through exec().
But Shell scripts don't run well with Runtime.exec() right ?
B'Cause, I tried it but the application did'nt throw up any exception. No message was flashed either. The process was just hanging.....so do you know a better method to actually run a shell script through a Java program ?

Similar Messages

  • How do i use an import statement in a java program

    I need to write a java program which will connect to the Database but i need to do an import like in DB2 which will load data to the table.
    How do i execute that import statement

    Are you saying that you need to add rows to a table in DB2 via a Java program? If so, you need to look at the JDBC API, (available on this site along with a bunch of tutorials). If not, post again with a clearer description of your problem.

  • Using DB2 views in crystal reports with java

    Post Author: Shikha Tomar
    CA Forum: JAVA
    Hello,
    We have used DB2 views in Crystal Report 11.
    We are able to view the report through crystal report tool but while using this rpt file in java application,the DB2 view is not found.
    It gives an error: "table SCDC.View_report not found."
    SCDC.View_report=Name of the view used in rpt
    Code for calling rpt is as below:
    The line marked as red gives the error:
    private static void switch_tables(DatabaseController databaseController) throws ReportSDKException, IOException {
    final String URI = "!com.ibm.db2.jcc.DB2Driver!jdbc:db2://"SERVERNAME":"PORT"/"DATABASE_NAME"!"+"";
    final String DATABASE_DLL = "crdb_jdbc.dll";
    //Obtain collection of tables from this database controller.
    Tables tables = databaseController.getDatabase().getTables();
    CommandTable commandTable=new CommandTable();
    //Set the datasource for all main report tables.
    for (int i = 0; i < tables.size(); i++) {
    ITable table = tables.getTable(i);
    //Keep existing name and alias.
    table.setName(table.getName());
    table.setAlias(table.getAlias());
    //Change properties that are different from the original datasource.
    table.setQualifiedName(TABLE_NAME_QUALIFIER + table.getName());
    //Change connection information properties.
    IConnectionInfo connectionInfo = table.getConnectionInfo();
    //Set new table connection property attributes.
    PropertyBag propertyBag = new PropertyBag();
    //Overwrite any existing properties with updated values.
    propertyBag.put("Trusted_Connection", "false");
    propertyBag.put("Server Name", SERVERNAME); //Optional property.
    propertyBag.put("Connection String", CONNECTION_STRING);
    propertyBag.put("Database Name", DATABASE_NAME);
    propertyBag.put("Server Type", "JDBC (JNDI)");
    propertyBag.put("URI", URI);
    propertyBag.put("Use JDBC", "true");
    propertyBag.put("Database DLL", DATABASE_DLL);
    connectionInfo.setAttributes(propertyBag);
    //Set database username and pasword.
    //NOTE: Even if these the username and password properties don't change when switching databases, the
    //database password is not saved in the report and must be set at runtime if the database is secured.
    connectionInfo.setUserName(DBUSERNAME);
    connectionInfo.setPassword(DBPASSWORD);
    connectionInfo.setKind(ConnectionInfoKind.SQL);
    //connectionInfo
    table.setConnectionInfo(connectionInfo);
    //Update old table in the report with the new table.
    databaseController.setTableLocation(table, tables.getTable(i));
    Regards,
    Shikha

    Hi,
    Fo business views please reffer to [Business Views Administrator's Guide|http://help.sap.com/businessobject/product_guides/boexir31/en/xi3-1_bv_admin_en.pdf]
    Yes, Crystal Reports 2008 can consume business views.
    Regards,
    Ramu.

  • ReportMigration Using LCM & Simple Import & Export.

    Hi,
    I just want to know the difference between these two.. migrating the reports using LCM or by a simple import & export.
    Will LCM even migrate the user security which is associated with the report??
    Can anybody throw some light on this.
    Thanks
    Jagadesh R K.

    Yes, LCM can be used to export / import Reports / Application provisioning.
    For more details, refer the below documents
    EPM 11.1.1.x
    http://download.oracle.com/docs/cd/E12825_01/epm.111/epm_lifecycle_management.pdf
    System 9.3.1
    http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/hss_alcm_util.pdf
    Hope this helps.
    Regards,
    Manmohan Sharma

  • How to use the google search from inside a java program

    Hi guys
    How can i use google search in my java program?
    What will be the type of the reply i get back from google?
    Thanks in advance
    [http://javamilestone.blogspot.com/|http://javamilestone.blogspot.com/]

    Hi,
    You have here some examples about how to make search on google from a Java application.
    The type of reply is JSON
    Here some documentation about it:
    [http://code.google.com/apis/ajaxsearch/documentation/#fonje|http://code.google.com/apis/ajaxsearch/documentation/#fonje]
    And here some snippets:
    [http://code.google.com/apis/ajaxsearch/documentation/#fonje_snippets|http://code.google.com/apis/ajaxsearch/documentation/#fonje_snippets]
    Regards,
    David.

  • SOLVED: How To Use LDAP over SSL (no certs) from java program

    Trying to connect to OID from Java program (using Grocery Store demo as a test). Want to use SSL with no server certificate. OID is configured, and ldapsearch -U 1 works.
    Tried using URL with ldaps, or adding SECURITY_PROTOCOL,"ssl". In both case the error is 'simple bind failed'.
    Samples on OTN say this should be possible, but then only have code for the non-ssl connection.
    Posting from others with this same question don't seem to have been answered.
    Message was edited by:
    user590350
    I have found that using ConnectionUtil.getSSLDirCtx() from Oracle will make a no-authentication SSL connection. An example in the sample code would be useful.

    Even with Java APIs, There is a way to talk through SSL without bothering about certificates. It's just that you will have to write some code and make some changes in settings.
    Read following to get further information on the same.
    http://kiranthakkar.blogspot.com/2007/04/dummny-certificate-authentication.html
    I don't know or I won't comment whether it's the right approach or not but it's definitely a work around.
    Thanking You
    Kiran Thakkar

  • Using a sql trigger to start a java program

    I want 2 create a trigger on an update to a table in SQL Server, that will start a java program, is this possible?
    and if so, how do I do this...?
    thanks

    tried something similar but not exactly, should work though. in the update trigger, in databases such as 8i onwards, use a java stored procedure to code an RMI client that calls the server. implement the server as Activatable and it should start up.

  • Import Export Imges in JAVA to binary code with firebirds

    I'm having problems with a java netbeans. I want a start a disccus about how we can import and export images from and to, binary code. We can play with Blob variables, but i dont know how can we insert to a Firebird database and how we can read this image.
    Any help or any comment is great.
    Thank you!!

    Hi,
    I'm not sure how much help you'll find here as firebird is not an oracle product. You might find someone who can provide sample code for doing the above into oracle/mysql here. I would suggest asking in the database general forum though rather than this one - you should be able to get a moderator to move it if you can;t do it yourself.
    Cheers,
    Rich

  • Using bash to import/export from qt

    i have an operation i perform repeatedly and would like to write
    a bash script to do it automatically.
    what i'd like to do is:
    1. open an image sequence in qtplayer
    2. file--->export
    3. set options (like custom size, what codec)
    4. save the export as the same filename as the first file of the image sequence
    can this be done via bash?
    can anyone point me to some info on passing parameters to qtplayer via bash?
    thanks,
    BabaG

    Have you tried using Applications -> Automator -> Record and then let Automator record steps you want to do. If that works, it would be the easiest way to automate this.
    If you want to invoke the Automator script you can use the open command from within bash
    If Automator -> Record does not work for you needs, then an Applescript is the next thing you should try. If you want to invoke this from bash use the osascript command.
    Applescript questions would be best asked in the Apple Applescript forum <http://discussions.apple.com/forum.jspa?forumID=724>
    If you want/need more bash shell script questions answered, the Apple Unix forum would be the best bet <http://discussions.apple.com/forum.jspa?forumID=735>
    And while I'm mentioning the open command, you can start *QuickTime Player* with a specific file usng open
    open -a /Applications/QuickTime Player.app file.jpg
    Where file.jpg could be any file that *QuickTime Player* knows how to handle.
    Steps 2, 3, & 4 are operations that would be better handled via Automator or Applescript.

  • Is it possible to call the import/export utilities from a procedure?

    I was just wondering if it is possible to call these utils as
    they are command line .exe's in Windows.
    Thanks
    Mike

    Hi ,
    Please check following thread on forum -
    Re: ADF: Calling OAF Page from ADF page
    Check this may also be useful-
    https://blogs.oracle.com/shay/entry/to_adf_or_oaf_or
    I have not tried yet but Steven Chan (Sr. Director OATG) suggest following methodolgy for this-
    https://blogs.oracle.com/stevenChan/entry/appsdatasource_jaas_ebs
    Thanks,
    Ashish

  • Using automator to import/export from qt

    i have an operation i perform repeatedly and would like to write
    an automator script to do it automatically.
    what i'd like to do is:
    1. open an image sequence in qtplayer
    2. file--->export
    3. set options (like custom size, what codec)
    4. save the export as the same filename as the first file of the image sequence
    can this be done via automator?
    can anyone point me to some info on passing parameters to qtplayer via automator?
    thanks,
    BabaG

    I would dearly like to know if there is a solution to this as well.
    Trying to bash out a Cleaner watch folder template where
    1) OSX will constantly monitor a drop folder
    2) wrap any image sequences up as Quicktimes
    3) send the Quicktime to a new folder for Cleaner to take over

  • Using XML to import/export large datasets

    Hi,
    I have a large customer who is using serveral aplications which
    exchange data. Now they use MQUE Series to put some data on the
    line. Each external application has his own interface.
    We would like to use one interface which uses XML and depending
    on what is in de xml-document, writes it in different Oracle
    databases.
    On a daily bases there must be created 500.000 records in de
    database, so performance is a hot issue.
    What are the possibilities and needed configuration (Oracle
    8...i) and how reliable it is going to be ?
    Suppose we want to use as much as pl/sql as possible.
    Thanks for any feedback,
    Ed
    [email protected]
    null

    Ed Somers (guest) wrote:
    : Hi,
    : I have a large customer who is using serveral aplications
    which
    : exchange data. Now they use MQUE Series to put some data on
    the
    : line. Each external application has his own interface.
    : We would like to use one interface which uses XML and
    depending
    : on what is in de xml-document, writes it in different Oracle
    : databases.
    : On a daily bases there must be created 500.000 records in de
    : database, so performance is a hot issue.
    : What are the possibilities and needed configuration (Oracle
    : 8...i) and how reliable it is going to be ?
    : Suppose we want to use as much as pl/sql as possible.
    : Thanks for any feedback,
    : Ed
    : [email protected]
    You should check out the Oracle Integration Server which was
    just announced at Openworld. It is ax XML Messaging Hub that
    incorporates workflow and has an adapter SDK to connect to your
    applications. It uses JMS as the envelope and XML as the payload.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    null

  • Invoking system utilities from java program

    Hi, I'm trying to write a program which will invoke system utilities when the user selects an appropriate option. The following code is a part of my app. But the problem is that I am not able invoke system utilities like chkdsk and disk defrag, which have specific exe's in system32 folder. I am able to invoke other exe's like Notepad.exe with the same code.
    import java.lang.*;
    public class Exec
    public static void main(String args[])
    try
    String [] st = {"C:\\WINDOWS\\system32\\chkdsk.exe"};
    Runtime var=Runtime.getRuntime();
    var.exec(st);
    catch(java.io.IOException e)
    Please tell me the problem and it's solution.

    Hi
    I am sending Class file .Call execute(String[] args) method in your class Exec file.
    it will print out put on screen .It works fine for me.
    I am using Windows NT .SO i used 'C:\\WINNT\\system32\\chkdsk.exe' execute command.
    Let me know any more infromation
    public class run {
         boolean flag = true;
         String message = "";
         String msg = "";
         String Error = "";
         Process p = null;
         public String execute(String[] args) {
                   try {
                        System.out.println("Please read it first here");
                        //run.getOutput(cmd,"call.txt");
                        StringBuffer sb = new StringBuffer();
                        StringBuffer sb1 = new StringBuffer();
                        p = Runtime.getRuntime().exec(args);
                        InputStream in = p.getInputStream();
                        InputStream in1 = p.getErrorStream();
                        int c;
                        while ((c = in.read()) != -1) {
                             //System.out.print("reached here---message ");
                             char ch = (char) c;
                             System.out.print(ch);
                             sb.append(ch);
                        System.out.println("Input String Buffer" + sb.toString());
                        msg = sb.toString();
                        int c1;
                        while ((c1 = in1.read()) != -1) {
                             flag = false;
                             //     System.out.println("reached here error ---message ");
                             char ch = (char) c1;
                             sb1.append(ch);
                        System.out.println("Error message is herr---" + sb1.toString());
                        Error = sb1.toString();
                        if(flag==false) message="EROOR :"+Error;else message="SUCCESS FULL:"+msg;
                        System.out.println("message value---"+message);                    
                   } catch (Exception ex) {
                        flag = false;
                        System.out.println("errror here" + ex);
                        return ex.getMessage();
                   System.out.println("message is here---" + message);
                   p.destroy();
              return message;
    Call
    public class Exec
    //import
    public static void main(String args[])
    try
    String [] st = {"C:\\WINNT\\system32\\chkdsk.exe"};
    System.out.println("Reached hefre ");
    run r=new run();
    r.execute(st);
    System.out.println("Reached after exect hefre ");
    catch(Exception e)
    System.out.println(" exception00---"+e);

  • Using XML Import/Export in Transport Connection

    Hi, I was investigating the feasibility of copying a query definition from one BW system to another using the XML Import/Export functionality in Transport Connection.  This is not to replace our current transport process across the landscape (Dev -> QA -> Prod), but merely just looking at possibilities for end users who develop queries in QA & then recreate them in Prod.
    My question is: has anyone worked with the XML Export/Import for types Queries & Query Elements?  I was trying this out between a Dev and Sandbox system and only had limited success.  I was able to take a small query and perform the Export to a local .xml file without much difficulty.  But when I try to do the Import, my query never shows up.  The Import function shows a green light, but I get a couple of error messages on the Import such as the following:
    ==========================================================
    SAP object 3WROG4HZ3NKP1PIYHCR1H24CQ () cannot be imported
    Diagnosis
    You attempted to import SAP object 3WROG4HZ3NKP1PIYHCR1H24CQ of type into the system via the XMI interface. However, you are not allowed to import SAP objects.
    System response
    The object was ignored during the import.
    Note: It can be that the import is incomplete when the required SAP objects are still not active in the system.
    Procedure
    Install the specified objects from Business Content. Only import the metadata afterwards.
    =========================================================
    The portion returned for Saving and Activating returns green lights.  The two sample objects mentioned appear to just be custom InfoObjects used in my query & don't look to be any different than others that work OK. 
    Just curious if anyone else has worked with this and could help advise. 
    Thanks...  Jody

    This is an old subject, but I think XML import only works for datamodeling objects like InfoObjects, InfoCubes, and ODS objects. If you try to export a query, and open the XML file in a text editor, there is not enough information (in my opinion) to build the query. As an example you don't see how key figures are to be displayed, filter or free characteristics.
    However, when an InfoObject is collected, you get all the attributes, texts in all languages.
    If anyone has more insight, please enlighten us.
    -John

  • CSS Import/Export Utility

    I'm trying to export users and groups along with their provisions using the CSS Import/Export utility, and I've configured my importexport.properties file to include export.provisioning.all=true, but the exported file does not include any provisioning. Is there a way to fix this?

    I agree with Seb. I could not get the 9.2.0.1 utility to work. It was exporting only native groups and the members in each group and not any provisioning info.
    Once I installed the 9.3.1 version of the utility, it all worked fine. Make sure you install JAVA JDK 1.5 as the utility needs that version. Just install in same path as the cssimportexport utility so that it doesn't conflict with any earlier versions of java (we had 1.4.2) on that server.
    Jeff

Maybe you are looking for

  • Mail hang with multiple pop accounts and invalid new mail counter

    All More than a year ago, I migrated all email accounts from Outlook to Apple Mail using O2M application. I have 2 pop accounts and gmail account. Everything worked fine for a few month but then Mail started to hang during message receiving. It did s

  • Problem with getting exact font

    Hello there, I am facing strange problem regarding getting exact document font. My sample code is-          var fontsArr = document.fonts;          for(var cnt = 0; cnt < fontsArr.length; cnt++){             var font = fontsArr[cnt];             aler

  • Budget check problem in BSP screen

    Hi Experts,                 We are using BSP internet online application to create the PR. I Configured list of Tolerance messages in the back end and i can able to see these soft warnings and hard stops in the backend PR creation process. My problem

  • Icon Transparency not working?

    I have a control in xcelsius using icons with the Transparency set to 0% (completely transparent in 4.5). They were working in 4.5 but after the upgrade to 2008, they did not work anymore From the help files: xcelsius 4.5: 0 being completely transpar

  • HT4759 how can i photo tream to window XP

    hello every one, im trying to install Icloud on my old window xp.is any one can help me out, what i like to do is,to share some of my pictures with friends and family,and i need to inatall my photo stream