Writing to Oracle from java  is painfully slow, can i speed it up?

I am testing the Collections.sort() method on java.util. I have a table with 100,000 numbers. From an external program, I connect, build an ArrayList filling it with a looped read, sort the items and write the sorted list back with:
for (Iterator i = list.iterator(); i.hasNext(); )
pstmt.setString(1,(i.next().toString()));
pstmt.executeUpdate();
Here are the results of each operations:
OP:Connecting...
----The operation took 2.094 seconds
OP:Building List...
----The operation took 6.562 seconds
OP: Sorting 100000 items...
----The operation took 0.547 seconds
OP: Writing Sorted List...
----The operation took 740.698 seconds
740!!! Argh
How can I do this faster?

You might want to batch your statements so you aren't making 100,000 trips to the database.

Similar Messages

  • Writing to Oracle is painfully slow, can i speed it up?

    I am testing the Collections.sort() method on java.util. I have a table with 100,000 numbers. From an external program, I connect, build an ArrayList filling it with a looped read, sort the items and write the sorted list back with:
    for (Iterator i = list.iterator(); i.hasNext(); )
    pstmt.setString(1,(i.next().toString()));
    pstmt.executeUpdate();
    Here are the results of each operations:
    OP:Connecting...
    ----The operation took 2.094 seconds
    OP:Building List...
    ----The operation took 6.562 seconds
    OP: Sorting 100000 items...
    ----The operation took 0.547 seconds
    OP: Writing Sorted List...
    ----The operation took 740.698 seconds
    740!!! Argh
    How can I do this faster?

    You might want to batch your statements so you aren't making 100,000 trips to the database.

  • Accessing user_tables and user_tab_columns of oracle from java

    hi, i can not access "user_tables" and "user_tab_columns" from java code while i can access them from TOAD.I connect to the database "HR", which is a sample database of oracle, as "normal".When i write:
    @Entity
    @Table(name="user_tab_columns")
    public class USER_TAB_COLUMNS{
    }it gives an error that user_tab_columns could not be found on the database.What can i do to access these tables from code?

    I think you have posted your question in the wrong forum. Try the [JDBC forum|http://forums.sun.com/forum.jspa?forumID=48].

  • Problem while connecting to Oracle from JAVA

    HI ,
    I am stuck with a problem.I could'nt connect from java to SQL.
    Do I need to install any drivers.I installed oracle 8i full version.and i am
    using j2sdk1.4.2.and included class12.zar file in class path......
    what els I have to do.
    please give me the solution.
    feel free to contact me at [email protected]

    I am stuck with a problem.I could'nt connect from java to SQL.
    Do I need to install any drivers.I installed oracle 8i full version.and i am
    using j2sdk1.4.2.and included class12.zar file in class path......
    what els I have to do.Well, what have you tried?
    You need the Oracle JDBC driver jar (ojdbc14.jar) which you can download from Oracle or somewhere I believe....I can't remember where I got it. Anyway, google for the Oracle JDBC driver and you should find it.
    You will probably need to read up on JDBC as I can't believe you even did that before you realised you needed a driver to connect. Good luck.
    feel free to contact me at [email protected]
    Nope.....post to forum, reply to forum.

  • PAINFULLY slow- can take 4 min to infinity to change tabs!

    I have a late 2008 MacBook Pro (original unibody MBP) that's running PAINFULLY slow! I used to be able to run 2 browsers with 15 tabs each, Photoshop, and word all at once. Over the last couple months, I can have as little as a browser with a few tabs and it grinds to a halt. I can simply click on a tab, or on a drop down menu, and I'll get the spinning beach ball for 4 or 5 minutes. Even cmd-opt-esc is unresponsive. Then, minutes later, it'll instantly execute anything I commanded over the last several minutes.  Firefox seems to be the worst offender, but it can happen no matter what's running.  It can happen immediately after rebooting, too (I used to only have to reboot every few weeks, now it's several times per day)
    CPU load is 98% idle after it catches up, but once it catches up and the graph refreshes and I can see it was about 60% user load and 15% system while it was choking on the monumental task of opening the "File" drop-down menu
    There are 482 threads and 129 processes.
    This is the original unibody Mac with 2.4 ghz core 2 duo. It's been upgraded with 4GB of ram (2.7 used) and a 1TB hard drive.  I did those upgrades 2 years ago and they've worked fine until recently.  Clicking  "get info" on the HD says 333 GB are free, but under "about this mac" it says 121 GB are free and 211 are used for "backup".  I'm running OS-X 10.9.2 and it says there are no updates to install.
    I've reset system manager
    I've reset PRAM
    I've fixed disk permissions.
    No effect
    I know I don't have the speediest machine, but even a mid-80's mac could smoothly handle a drop-down menu, and this is a recent problem.  I'm at a loss here, guys. Any idea? My computer is quickly becoming unusable!

    Great- Thanks!  Here's the info...
    Hardware Information:
              MacBook Pro (15-inch, Late 2008)
              MacBook Pro - model: MacBookPro5,1
              1 2.4 GHz Intel Core 2 Duo CPU: 2 cores
              4 GB RAM
    Video Information:
              NVIDIA GeForce 9400M - VRAM: 256 MB
              NVIDIA GeForce 9600M GT - VRAM: 256 MB
    System Software:
              OS X 10.9.2 (13C1021) - Uptime: 0 days 3:17:46
    Disk Information:
              SAMSUNG HM100UI disk0 : (1 TB)
                        EFI (disk0s1) <not mounted>: 209.7 MB
                        Macintosh HD (disk0s2) / [Startup]: 999.35 GB (121.34 GB free)
                        Recovery HD (disk0s3) <not mounted>: 650 MB
              MATSHITADVD-R   UJ-868 
    USB Information:
              Apple Inc. Built-in iSight
              Apple Inc. BRCM2046 Hub
                        Apple Inc. Bluetooth USB Host Controller
              Apple, Inc. Apple Internal Keyboard / Trackpad
              Apple Computer, Inc. IR Receiver
    Thunderbolt Information:
    Gatekeeper:
              Anywhere
    Kernel Extensions:
              [not loaded] com.parallels.kext.prl_hid_hook (4.0 3522.205912) Support
              [not loaded] com.parallels.kext.prl_hypervisor (4.0 3522.205912) Support
              [not loaded] com.parallels.kext.prl_netbridge (4.0 3522.205912) Support
              [not loaded] com.parallels.kext.prl_usb_connect (4.0 3522.205912) Support
              [not loaded] com.parallels.kext.prl_vnic (4.0 3522.205912) Support
              [not loaded] com.roxio.TDIXController (1.7) Support
    Startup Items:
              FanControlDaemon: Path: /Library/StartupItems/FanControlDaemon
    Launch Daemons:
              [loaded] com.adobe.fpsaud.plist Support
              [loaded] com.google.keystone.daemon.plist Support
              [loaded] com.microsoft.office.licensing.helper.plist Support
    Launch Agents:
              [running] com.canon.MFManager.plist Support
              [loaded] com.google.keystone.agent.plist Support
    User Launch Agents:
              [failed] com.adobe.ARM.[...].plist Support
              [loaded] com.facebook.videochat.[redacted].plist Support
              [loaded] com.macpaw.CleanMyMac2Helper.diskSpaceWatcher.plist Support
              [loaded] com.macpaw.CleanMyMac2Helper.scheduledScan.plist Support
              [loaded] com.macpaw.CleanMyMac2Helper.trashWatcher.plist Support
    User Login Items:
              Temperature Monitor
              Quıcĸsıɩⅴεʀ
              WDQuickView
              HP Scheduler
    Internet Plug-ins:
              o1dbrowserplugin: Version: 5.3.1.18536 Support
              Google Earth Web Plug-in: Version: 6.1 Support
              Default Browser: Version: 537 - SDK 10.9
              Flip4Mac WMV Plugin: Version: 2.3.2.6 Support
              Silverlight: Version: 5.1.20913.0 - SDK 10.6 Support
              FlashPlayer-10.6: Version: 13.0.0.206 - SDK 10.6 Support
              Flash Player: Version: 13.0.0.206 - SDK 10.6 Support
              iPhotoPhotocast: Version: 7.0
              googletalkbrowserplugin: Version: 5.3.1.18536 Support
              QuickTime Plugin: Version: 7.7.3
              AdobePDFViewer: Version: 9.5.4 Support
              CANONiMAGEGATEWAYDL: Version: 3.1.0.2 Support
              GarminGpsControl: Version: 2.8.2.0 Release Support
              SharePointBrowserPlugin: Version: 14.3.6 - SDK 10.6 Support
              JavaAppletPlugin: Version: 14.9.0 - SDK 10.7 Check version
    Audio Plug-ins:
              BluetoothAudioPlugIn: Version: 1.0 - SDK 10.9
              AirPlay: Version: 2.0 - SDK 10.9
              AppleAVBAudio: Version: 203.2 - SDK 10.9
              iSightAudio: Version: 7.7.3 - SDK 10.9
    iTunes Plug-ins:
              Quartz Composer Visualizer: Version: 1.4 - SDK 10.9
    User iTunes Plug-ins:
              TuneUp Visualizer: Version: 2.4.0 - SDK 10.7 Support
    User Internet Plug-ins:
              fbplugin_1_0_3: Version: (null) Support
              WebEx: Version: 1.0 Support
    3rd Party Preference Panes:
              Fan Control  Support
              Flash Player  Support
              Flip4Mac WMV  Support
              Growl  Support
              MacFUSE  Support
    Time Machine:
              Skip System Files: NO
              Mobile backups: ON
              Auto backup: YES
              Volumes being backed up:
                        Macintosh HD: Disk size: 930.71 GB Disk used: 817.71 GB
              Destinations:
                        Time Machine Backups [Local]
                        Total size: 3 
                        Total number of backups: 22
                        Oldest backup: 2014-03-12 09:26:21 +0000
                        Last backup: 2014-04-07 15:52:25 +0000
                        Size of backup disk: Excellent
                                  Backup size 3  > (Disk size 930.71 GB X 3)
                        Seagate-40A98A TM Backup [Network] (Last used)
                        Total size: 4 
                        Total number of backups: 34
                        Oldest backup: 2014-03-12 09:26:21 +0000
                        Last backup: 2014-04-21 16:19:38 +0000
                        Size of backup disk: Excellent
                                  Backup size 4  > (Disk size 930.71 GB X 3)
              Time Machine details may not be accurate.
              All volumes being backed up may not be listed.
    Top Processes by CPU:
                   0%          Google Chrome
                   0%          TemperatureMonitor
                   0%          WindowServer
                   0%          fontd
                   0%          FanControlDaemon
    Top Processes by Memory:
              324 MB          Finder
              123 MB          com.apple.IconServicesAgent
              119 MB          Google Chrome
              90 MB          mds_stores
              79 MB          com.apple.WebKit.WebContent
    Virtual Memory Information:
              125 MB          Free RAM
              1.58 GB          Active RAM
              1.51 GB          Inactive RAM
              552 MB          Wired RAM
              2.23 GB          Page-ins
              0 B          Page-outs

  • Safari interface is painfully slow but broadband speed fine

    Hi there - for the last few days using the interface on my Safari has been paaaaainfully slow (writing text, changing tab, scrolling etc). However my broadband speed seems fine (8.7MB). Any suggestions for how to fix the interface speed? I have shut down iPhoto and iTunes but no improvement.
    Bizarrely writing this right now is working fine but moving between tabs and writing in Gmail are still very slow...
    I am not very tech savvy so any simple suggestions would be very much appreciated - thank you!

    Hi and Welcome to Apple Discussions
    Some routers are better than others on a Mac. It's all about the firmware and the degree of compatibility built into it by the developer. Make sure you have the latest Netgear firmware installed on the router. Check the support page on Netgear's site.
    Also, in the Netgear Router preference panel, add these DNS server codes, which may facilitate the page loading on the Mac - 208.67.220.220 and 208.67.222.222. There are OpenDNS codes, which have been shown to be much more efficient for Safari than those used by Internet Providers.

  • Podcast conversion painfully slow; can't add chapters while recording?

    I'm finding GB3's conversion to m4a very, very slow.
    For the last six months, I was using GB2 to mix my audio, iTunes to convert to m4a, and PodcastAV to add chapters and pictures. The mixdown process takes the same amount of time (10 minutes for an hour long podcast), but GB3 takes over half an hour to convert the audio to 64 kbps audio! In comparison, the equivalent iTunes takes three or four minutes to do the same. Is GarageBand not using the Velocity Engine?
    Additionally, if I make any changes to the chapter info in GB3, I have to go through this painful 40+ minute process once again. Tools like PodcastAV and ChapterToolMe can take existing m4a files and simply pass it through unchanged, only modifying the chapter info. Is there a way around this?
    Also, is there a way to add podcast chapters while recording? When recording, I can't select the podcast track to the "add chapter" button...
    Gotta say I'm disappointed so far.
    17" powerbook (1.67)   Mac OS X (10.4.4)  

    OK, i have played a bit more with Iphoto and GarageBand. It is really the size of the pictures. The original size of my pictures is 2048x1536px. If i make the pictures much smaller, i can add them from the mediabrowser into the podcast.
    What i now don't understand, why does it work if i drag them from the finder into garageband without editing the size? And what dimenson should the fotos have for optimal performance in the cast?

  • VARRAY colletion type retirval from java , Wrong data ???? retrieved.

    Hi all,
    I am trying to retirve VARRAY collection type created in oracle from Java. It gives the wrong results as below:
    ********Fetch Starts....********
    ********Row 1 :
    Array is of type MY_UID.STRING_VARRAY
    Array is of length 2
    index 0 = ???
    index 1 = ???
    ********Fetch Ends....********
    Note: I nls_charcterset12.jar, classes12.jar are included in project class path.
    After breaking my head for two decided to request for help from big brains out there.
    For understanding, the code is attached and any help would be appriciated on this regard.
    Advance Thanks,
    Venkat
    The Code:
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.oracore.Util;
    import oracle.jdbc.*;
    public class VArrayManipulation
    public static void main (String args[])
    throws Exception
    // DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    // The sample retrieves an varray of type "STRING_VARRAY",
    // materializes the object as an object of type ARRAY.
    // A new ARRAY is then inserted into the database.
    // String url = "<connection url>";
    // Connect to the database
    Connection conn =null;
    // DriverManager.getConnection (url, "<user>" , "<password>");
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    conn = DriverManager.getConnection(
    "jdbc:oracle:thin:@localhost:1521:system", "my_uid","my_password");
    conn.setAutoCommit (false);
    // Create a Statement
    Statement stmt = conn.createStatement ();
    try
    stmt.execute ("DROP TABLE sample_varray_table");
    stmt.execute ("DROP TYPE string_varray");
    catch (SQLException e)
    //Exceptions will be thrown if Table and types doesnt exist . Ignore this
    stmt.execute ("CREATE TYPE string_varray AS VARRAY(10) OF VARCHAR2(100)");
    stmt.execute ("CREATE TABLE sample_varray_table (acol string_varray)");
    //Insert using SQL
    stmt.execute ("INSERT INTO sample_varray_table VALUES (string_varray('Test1', 'Test2'))");
    ResultSet rs = stmt.executeQuery("SELECT acol FROM sample_varray_table");
    printResultSet (rs);
    //Insert using ArrayDescriptor
    // create a new ARRAY object
    String arrayElements[] = { "Test3", "Test4" };
    ArrayDescriptor desc = ArrayDescriptor.createDescriptor
    ("STRING_VARRAY", conn);
    ARRAY newArray = new ARRAY(desc, conn, arrayElements);
    PreparedStatement ps =
    conn.prepareStatement ("insert into sample_varray_table values (?)");
    ((OraclePreparedStatement)ps).setARRAY (1, newArray);
    ps.execute ();
    rs = stmt.executeQuery("SELECT acol FROM sample_varray_table");
    printResultSet (rs);
    // Close all the resources
    rs.close();
    ps.close();
    stmt.close();
    conn.close();
    public static void printResultSet (ResultSet rs)
    throws SQLException
    System.out.println("********Fetch Starts....********");
    int line = 0;
    while (rs.next())
    line++;
    System.out.println("********Row "+line+" : ");
    ARRAY array = ((OracleResultSet)rs).getARRAY (1);
    System.out.println ("Array is of type "+array.getSQLTypeName());
    System.out.println ("Array is of length "+array.length());
    // get Array elements
    String[] values = (String[]) array.getArray();
    for (int i=0; i<values.length; i++)
    System.out.println("index "+i+" = "+values[i] );
    System.out.println("********Fetch Ends....********");
    }

    import java.sql.Array;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import oracle.sql.ARRAY;
    import oracle.sql.ArrayDescriptor;
    public class test
        public static void main (String args[]) throws Exception
            DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
            Connection conn = DriverManager.getConnection
                ("jdbc:oracle:thin:@sta00077.us.oracle.com:1521:xe", "scott","tiger");
            Statement stmt = conn.createStatement ();
            try {
                stmt.execute("DROP TABLE varray_table");
                stmt.execute("DROP TYPE string_varray");
            } catch (Exception e) { }
            stmt.execute("CREATE TYPE string_varray AS VARRAY(10) OF VARCHAR2(10)");
            stmt.execute("CREATE TABLE varray_table (sv string_varray)");
            stmt.execute("INSERT INTO varray_table VALUES (string_varray('Test1', 'Test2'))");
            ResultSet rs = stmt.executeQuery("SELECT sv FROM varray_table");
            printResultSet(rs);
            String arrayElements[] = { "Test3", "Test4", "Test5" };
            ArrayDescriptor desc = ArrayDescriptor.createDescriptor("STRING_VARRAY", conn);
            ARRAY newArray = new ARRAY(desc, conn, arrayElements);
            PreparedStatement ps = conn.prepareStatement("INSERT INTO varray_table VALUES (?)");
            ps.setArray(1, (Array)newArray);
            ps.execute();
            rs = stmt.executeQuery("SELECT sv FROM varray_table");
            printResultSet(rs);
            rs.close();
            ps.close();
            stmt.close();
            conn.close();
        public static void printResultSet (ResultSet rs) throws Exception
            System.out.println("******** Fetch Starts ********");
            int line = 0;
            while (rs.next()) {
                line++;
                System.out.println("*** Row " + line + " ***");
                Array array = rs.getArray(1);
                String[] values = (String[])array.getArray();
                System.out.println ("Array is of type " + array.getBaseTypeName());
                System.out.println ("Array is of length " + values.length);
                for (int i = 0; i < values.length; i++)
                    System.out.println("Index " + i + " = " + values);
    System.out.println("******** Fetch Ends ********");

  • How to call c++ code from java

    i have a third party dll written in c++. I want to call its methods in java. I searched web and found that I have to use JNI for this. I have seen examples on web writing c++ code and then using it from java through JNI, but can anybody please point to me the example where i have a predefined library or dll in c++ and i have to call it in java. I think that I may have to declare methods in library as native in java and then write a wrapper implementation (dll) in c++ which actually calls the library or dll functions. But, then how will I call methods of dll from my wrapper code.
    Any examples, please point
    Regards,
    Farooq

    There's a JNI forum here that may be a better place for this question; though given the general nature of the question, I suspect that they'll refer you to a tutorial. good luck.

  • Help:create tree node dynamically from java code...

    hi there...can anyone give me solution how to create or add tree node dynamically from java code???
    currently i am using tree node to handle my menu...i try to create tree and add treenode dynamically from .java page, but it failed...can anyone give solution how to create tree ui from java code, so i can create a dynamic menu...thanz before...

    Hi:
    Just put the statements you would normally put on a sqlplus command line in jdbc statements and execute them?
    http://www-db.stanford.edu/~ullman/fcdb/oracle/or-jdbc.html#0.1_executeUpdate
    MJG

  • Are Oracle spatial java libraries redistributable?

    Hi,
    Do you have any idea about Oracle's policy on distributing Oracle Spatial Java Class Libraries? Can our software that is targeted for commercial purpose distribute it?
    We are using these SDO java libraries.
    oracle_sdo.jar
    sdoapi.jar
    sdogr.jar
    sdonm.jar
    sdotopo.jar
    sdoutl.jar
    Also if redistribution is not allowed, can our users having Oracle DB license, copy these libraries from their Oracle DB machine to the machine where our product is installed.
    Please guide us to appropriate web link on this topic. We could not get clear information by going through Oracle sites.
    Thanks in advance,
    Subrahmanyam.

    Go to: http://www.oracle.com/technology/software/products/spatial/index.html
    Then click one of the downloads and you get the "Oracle Technology Network Development and Distribution License Terms". The second box covers the distribution license.
    I'm sure that its covered in there .... Lots of Legal Mumbo-Jumbo ...... But it contains this line:
    "You may also distribute the programs with your applications to your customers."
    So it looks like "Yes" is the answer to your question !
    Ro

  • Send Datetime2 value to a SQL Procedure from Java using Hibernate

    Hi All,
    I Have a Procedure which takes a parameter of type datetime2.
    The procedure is called from Java Hibernate.
    How can I Pass datetime2 value to SQL procedure from Java?
    Thanks in advance,
    Shraddha Gore

    You may define a global empty array in some package. Then you can do:
    SQL> CREATE OR REPLACE PACKAGE pkg
    AS
       g_empty   DBMS_SQL.varchar2_table;
    END pkg;
    Package created.
    SQL> CREATE OR REPLACE PROCEDURE p (
       p_tuids   IN   DBMS_SQL.varchar2_table "DEFAULT pkg.g_empty"
    AS
    BEGIN
       NULL;
    END p;
    Procedure created.
    SQL> BEGIN
       p ();
    END;
    PL/SQL procedure successfully completed.

  • How to set genericObject in a TaskInstance from java

    Hi,
    How can I set generiobject to a taskInstace from java?
    And
    How can I get a variable of any other taskInstace in workFlow?
    Please suggest me.
    Thanks ,
    Ravi.G

    Hi,
    How can I set generiobject to a taskInstace from java?
    And
    How can I get a variable of any other taskInstace in workFlow?
    Please suggest me.
    Thanks ,
    Ravi.G

  • Unable to execute Linux command from Java

    Hi,
    I am currently working on a code wherein i need to execute Linux command from Java. Below are some of the query i have.
    1) Is there any efficient method of running OS commands from Java, rather than using Runtime and Process method.
    2) Below is details of my code which fails in execution
    **-- Java Version**
    java version "1.6.0"
    OpenJDK Runtime Environment (build 1.6.0-b09)
    OpenJDK Server VM (build 1.6.0-b09, mixed mode)
    -- Program Code ----
    Where <path> = Path i put myself
    package test;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileReader;
    import java.io.*;
    public class GetInode{
         * @param args
         public static void main(String[] args) {
              GetInode test = new GetInode();
              test.getInode();
         public void getInode(){                    
              String command = "/usr/bin/stat -Lt <path>;
              System.out.println(command);
              Process process;
              Runtime rt;     
              try{
              rt = Runtime.getRuntime();               
              process = rt.exec(command);
              InputStreamReader isr = new InputStreamReader(process.getErrorStream());
              BufferedReader bre = new BufferedReader(isr);
              BufferedReader br = new BufferedReader(new InputStreamReader(process.getInputStream());
              System.out.println(bre.readLine());
    System.out.println(br.readLine().split(" ")[7]);
              process.destroy();          
              }catch (Exception ex){
                   System.out.println("Error :- " + ex.getMessage());
    ------Output -------------
    /usr/bin/stat -Lt "<path>"
    /usr/bin/stat: cannot stat `"<path>"': No such file or directory
    Error :- null
    Can any one help me what is wrong and why i am unable to run the Linux command from Java.

    For clarity purpose............i m submitting actual code here
    --- Code ---
    package test;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileReader;
    import java.io.*;
    public class GetInode{
    * @param args
    public static void main(String[] args) {
    GetInode test = new GetInode();
    test.getInode();
    public void getInode(){               
    String command = "/usr/bin/stat -Lt \"/afs/inf.ed.ac.uk/user/s08/s0898671/workspace/CASWESBLIN/TestFS/01_FIL_01.txt.txt\"";
    System.out.println(command);
    Process process;
    Runtime rt;
    try{
    rt = Runtime.getRuntime();
    process = rt.exec(command);
    InputStreamReader isr = new InputStreamReader(process.getErrorStream());
    BufferedReader bre = new BufferedReader(isr);
    BufferedReader br = new BufferedReader(new InputStreamReader(process.getInputStream()));
    System.out.println(bre.readLine());
    System.out.println(br.readLine().split(" ")[7]);
    process.destroy();
    }catch (Exception ex){
    System.out.println("Error :- " + ex.getMessage());
    --- Output ---
    [ratz]s0898671: java GetInode
    /usr/bin/stat -Lt "/afs/inf.ed.ac.uk/user/s08/s0898671/workspace/CASWESBLIN/TestFS/01_FIL_01.txt.txt"
    /usr/bin/stat: cannot stat `"/afs/inf.ed.ac.uk/user/s08/s0898671/workspace/CASWESBLIN/TestFS/01_FIL_01.txt.txt"': No such file or directory
    Error :- null
    -- Linux Terminal --
    If i copy the first line from the output and execute on Linux terminal her is the output that i get
    [ratz]s0898671: /usr/bin/stat -Lt "/afs/inf.ed.ac.uk/user/s08/s0898671/workspace/CASWESBLIN/TestFS/01_FIL_01.txt.txt"
    /afs/inf.ed.ac.uk/user/s08/s0898671/workspace/CASWESBLIN/TestFS/01_FIL_01.txt.txt 12003 24 81a4 453166 10000 1c 360466554 2 0 1 1246638450 1246638450 1246638450 4096
    Can you just assist me where am i really making mistake.......i was wondering if the command that i pass from Java....can be executed on Linux terminal why is it faling to run from java.........and when i print the Error Stream for process output........it show cannot Stat.......

  • Calling Fortran from Java

    Is it possible to call Fortran code from java??

    You can use Runtime.exec() to run an application written in Fortran.
    If you can write C/C++ code which interacts with something written in fortran then you can use JNI to connect it to java.
    Presumably the fortran app doesn't already have an interface that allows something to interact with it when it runs - like a socket interface.

Maybe you are looking for