Oracle developer needs Java help

I develop applications in Oracle 8i on NT4. As part of a trigger, I need to perform an update to an extremely large table which takes many minutes. Because it's tied to a web page, I can't wait for the update to complete. Oracle natively doesn't support system calls -- I use the Shell() command in VB -- but Oracle DOES support Java stored procedures. I'm hoping that a Java stored procedure will be able to spawn/execute a new process/program specified by a command line instruction (ie: "C:\SQLPLUS.EXE SCOTT/TIGER @update.sql") and return immediately - without waiting for the process to complete. There doesn't need to be any handle for or call back from the process - just fire and forget. Can anyone provide me some direction, or better some existing Java code that does this? THANKS!

Hi "todmcg",
I'm not sure that I have understood your question correctly, but here goes anyway...
Yes you can create a java stored procedure and have a trigger execute that procedure. In order to execute system commands in java, you usually use the "exec()" method of class "java.lang.Runtime". It is also easy to spawn new threads using java. So yes, you can have your java stored procedure execute a system command in a background thread.
In my opinion, the Oracle documentation explains very well how to create a java stored procedure. The documentation is available from:
http://tahiti.oracle.com
Also, examples of how to call system commands from java stored procedures are available at this Web site:
http://asktom.oracle.com
You may also find relevant information at:
http://metalink.oracle.com
and
http://technet.oracle.com
Of-course, you can also use JDBC from your java stored procedure to execute your "update.sql" script -- without the need to execute a system command.
Basic code skeleton:
[NOTE: Untested and may contain syntax errors.]
public class SystemCommand implements Runnable {
  private static String cmd;
  public void run() {
    Runtime runtime = Runtime.getRuntime();
    runtime.exec(cmd);
  public static void execCommand(String cmd) {
    this.cmd = cmd;
    new Thread(new SystemCommand()).start();
}Hope this helps you.
Good Luck,
Avi.

Similar Messages

  • From Oracl Developer to Java Please  Guide me

    Hi
    i am presently making Database applications using Oracle Developer as tool. I want to shift to Database solutions using Java as front end. Will it be better to switch on to Java from Developer? I would like to know all pros and cong regarding it
    Thanks
    vikas joshi

    one point: if you use Java, you would develop in standard SQL, because the Java JDBC API is database independend. of course, you could also use the Oracle specific things with the ORACLE JDBC-Driver or just call specific stored procedures via JDBC, but then: what's the benefit in using Java if you code specific ORACLE apps? so, you should change your way of developing database applications from "developing ORACLE apps" to "developing SQL apps" ... just a suggestion.

  • Oracle Blob using Java help (Error: JVM_recv in socket input stream read )

    I am trying to insert a record with Blob column (size of image 'mg.jpg' about 15KB) and I get the runtime error:
    [java] java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read
    [java]      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    [java]      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    [java]      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
    [java]      at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2061)
    [java]      at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
    [java]      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
    [java]      at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
    [java]      at test.ProvisioningParser.TestBlob.main(Unknown Source)
    This is what code looks like: I am not sure what's wrong, any help appreciated. Thanks!
         try{
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                   con = DriverManager.getConnection("jdbc:oracle:thin:@VALUED-20606295:1521:dbbook","jvending","jvending");
                   java.util.zip.ZipInputStream zip = new java.util.zip.ZipInputStream(new java.io.FileInputStream(new java.io.File("D:\\work\\mywork\\source\\test\\ProvisioningParser\\test.par"))) ;
                   int len = 0 ;
                   java.util.zip.ZipEntry entry = null;
                   do{
                        entry = zip.getNextEntry();
                        if (entry != null){
                             if (entry.getName().equalsIgnoreCase("mg.jpg")){
                                  len = (int)entry.getSize();
                                  break;
                   }while(entry!=null) ;
                   stmt = con.prepareStatement( "Insert into icon (parid, clientbundleid, id, iconfile ) values ( ?,?,?,?)"
                         stmt.setString(1,"101");
                         stmt.setString(2,"101");
                         stmt.setInt(3,1);                    
                         stmt.setBinaryStream( 4, zip, len);
                   stmt.setQueryTimeout(0);
                   stmt.executeUpdate();
                   con.close();               
              catch(Exception e){
                   e.printStackTrace();
              }Thanks,
    Rashmi

    As a guess what you are doing with that zip stuff is very odd.
    You do realize that it is just going to put some binary data into the blob right? And the methods that is going to use will not necessarily create a 'complete' zip file?
    If you want a zip file then just load the file, dont use the zip classes.
    And if you want part of a zip file, (and want to store the parts as a zip) then extract it from the file and create another zip entity using a byte stream rather than a file.
    Finally I suspect your error with the blob occurs because you do not close the statement. But at any rate you should figure out how to do the blob code independent of the zip stuff.
    And what oracle driver version are you using? Some of the older ones need oracle specific handling for blobs.

  • VB Programmer needs java help

    I am a VB programmer and have started to learn Java a little bit. I need this program to be written anytime by Monday, but it must be written in java because they plan to use it on multiple platforms. Our java programmer quit and I don't know enough to write it in java. The program is to figure payroll. The user will input their name and remove the check in the hourly check box if they are salaried. If the employee is hourly, then any hours worked over 40 are time and a half. If they are salaried, they must choose what company level they are. I have included the three salary levels below. The program then needs to print to the screen in the bottom text box their yearly salary computed for a 40 hour work week. Can anyone help me and write the program? Whoever will do this for me, I will award 34 duke dollars. That is all I have.
    Thank you so much for your help,
    Kori
    Name:
    Text box here for name
    (check box) Hourly
    Hours:
    Text box here for hours
    (option button) Level 1
    (option button) Level 2
    (option button) Level 3
    (option button) Level A
    (option button) Level B
    Total Pay:
    Number Processed:
    (command button) (command button)
    Calculate Pay__________Clear
    (text box)
    shows "payoll report"
    Level 1 = 6.25f
    Level 2 = 8.15f
    Level 3 = 10.85f
    Level A = 27000f
    Level B = 42000f
    Max hours is 80.0f

    I am a VB programmer and have started to learn Java a
    little bit. I need this program to be written anytime
    by Monday, but it must be written in java because they
    plan to use it on multiple platforms.Do this this little toy program in VB so you have a working solution on one platform by Monday. Show it to your boss and say you did a rapid prototype first for people to evaluate. Then take your time and convert it to Java.
    /Ulrika the pragmatical.

  • Oracle History-Need ANY help.

    My Highschool international Business class require us to reasearch on a company, and i landed on Oracle...
    I think oracle will be good because it is informational driven and we are in an informational age, what's more, some chairman of oracle said he admires risk takers, so i liked it.
    But i did not find all the information I need in oracle's History page, so I decided to post a topic and wish someone would help.
    To topic, I would like information as follow to finish my project:
    1. The foundation or oracle, where did it started, who started it? where was its HQ? where is the HQ now?
    2. The history of Oracle international business, Which country other than U.S did oracle made an investment first? Where is its HQ? It would be wonderful if I can have a listed timeline of oracle international history.
    3. Ablility to adapt to cultural and economic situations: How does oracle vary to adapt to its international out posts where the culture and economy pattern might be different? (for exp, McDonalds serve Hot wings as a regional product in China, which is not available in US)
    4. Sucess and Failures: I know some of the sucess already after browsing oracle's history site, how it saved 1billion dollar and ects, but I need failures too, which move by oracle is unsucessful?
    5. Future prospects of oracle: What kind of product is oracle wish to provide in the future? Where shall oracle add investments? Explain.
    All help will be DEEPLY appreciated.

    To be frank, this is a technical forum not a thesis writing service. Also I'm not sure you've done even the basic research - this page on the Oracle website would answer all you questions in (1). But anyway, here are some links to help you.
    There are a number of books on Oracle and Larry Ellison. Even if you can't buy them I'm sure you can obtain them through your school's library.
    The ORAFAQ website has some useful kicking off points. Beyond that you'll want to start Googling for more info. Remember though, lots of stuff on the web is unreliable. The same is true of books, but to a lesser extent, because there tends to be more peer review and editorial fact-checking when it comes to deadtree technology.
    Cheers, APC

  • Need java help

    hi, i hope this is the right place to put this question. i have a optiplex gxi with a 3geg. hardrive. and 64mb of ram.with windows me. when i download java to play on pogo the games will load but they drag and freeze up. the only java download i can get is jre 5.0 update 16 i think i have uninstalled it compleatly.because i keep getting all kinds of errors one i get is ie6 will hang and i get a send to microsoft error report. when i try to update java i get an error number 1723 windows installer error. i can not update the windows installer or even download net framework. please can someone help. (i miss pogo) i have tried to install msjvm but that doesn't work either. sorry for my typeing skills i hope you can help thank you.

    brightsmile29 wrote:
    thank you for your reply however my computer is not compatable with ie7 i have windows me. whice is not supported. and i can not download java so therefore i have no java installed. any help would be gratefull.That ME based system is beyond it's life span at this point in time. You can use JRE's that were developed about that time--Up to 1.4x (I think, you may get away with early 5).
    So basically you have to face reality--that OS, machine, and JVM's have fallen off the grid for the most current games.
    If you have completely uninstalled Java, then run regclean several times and then load the last usable version of Java that you have had installed in the past--and realize, the newer stuff is not made for that era of machine.

  • Need java help urgent plzzz

    Ive never visited a Java forum other than this one and its been over 2 years now. Out of curiosity I just went to JavaRanch.
    Ive seen a lot of heated flaming from both sides (on these forums)
    but i figured id take a look today.
    The FIRST post i look at someone asks what the purpose of an
    interface is and one of the responses he gets is:
    "Please revise your display name to meet the JavaRanch Naming Policy. To maintain the friendly atmosphere here at the ranch, we like folks to use real (or at least real-looking) names, with a first and a last name.
    You can edit your display name here. Thank you for your prompt attention!"
    i wish i could go to 33 pt font: WTF IS THAT?
    WEIRD!
    Thats just way to creepy for me and im out... as if the brown and the
    meesen (brian regan joke) everywhere werent enough.
    Anyone know any other good ones?
    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=33&t=019908

    JavaRanch scares me as well. Yea i think the ranch is making an army of cattle.
    Ill check out devshed.
    http://www.javaranch.com/name.jsp
    SO F*CKING SCARY:
    "I understand that in some cultures there is no such thing as "first name and last name" - there is just one name. If you are one of these people, I WOULD LIKE TO HUMBLY ASK YOU TO SACRIFICE A PIECE OF YOUR CULTURE to help me build this culture."
    apparently the cows love the policy though:
    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=10&t=001017

  • Newbie needs java help

    Hi,
    I have used Captivate for a while, but have no idea where to
    begin to insert JavaScript into Captivate. Everyone talks about it,
    but I can't find a very basic beginner explanation for this. I
    don't even know WHERE to put the JavaScript.

    Dear Altruistic
    Thanks for the link to the Netbeans quickstart webpage sadly it does not contain any visual cues as to what proceedures are neccessary to implement the instructions.
    For someone like me ( learning disability) this can cause difficulties I learn in a slightly different way to those who are able to assimilate written instructions.
    The text might as well have been ancient Greek ...
    I really need a discriptive walk through lets give an exampleso you will understand my needs ... say I wanted to open a Microsoft word document on the desktop of a windows PC (ok not a good choice but there you are ) here is how I would begin to write the proceedure
    1. look at the bottom left hand side of your screen
    can you see a windows symbol with start displayed ?
    yes ..
    Hold your mouse over the start icon and left click .. then use the cascading menu feature to select office 2003 ...
    Do you get the general idea about what I need here ....?
    So have a look at the link on my original post that points to David Eck's website where he lists some Java source code and if possible give me the proceedure of how to run this from within the Netbeans environment.
    Once I can do this I will be able to teach myself ....
    I guess in a nutshell what I am saying is why on earth is their not just a simple feature on the GUI that allows you to import some code and for Netbeans to run in Demo mode ! I know their is sample projects included within the application but here again this does not solve my problem of notbeing able to find a way to run source code from the application.
    I hope this makes sense !

  • I'm a new Oracle Developer, need a Documentation

    Hi all,
    Can you send me a link with a documentation about Oracle Database (Basics concepts, Stored Procedure and Triggers).
    I'm a dba Sql Server but a want to migrate.
    Tks,
    Mura

    http://www.oracle.com/technology/documentation/index.html

  • Need Java Help on a Mortgage program

    I keep getting the following error.
    java:20: illegal start of expression
    public Scanner myScanner = new Scanner(System.in);
    /*Danielle Safonte*/
    /* Week 2 Mortgage Calculator*/
    import java.util.Scanner;
    import java.io.*;
    import java.text.*;
    public class Week2Assignment
    int principle = 200000;
    float interest = .0575;
    int term = 30;
    int months;
    float paymentdue;
    float calculation;
    public static void months()
    public Scanner myScanner = new Scanner(System.in);
    System.out.print("What month of the loan is this?" + months);
    if (months = term) {
    System.out.print("You have paid off your loan");
    else
         months = myScanner.next();
         float Jinterest = (interest / (months*100));
         calculation = principle * (Jinterest/(1-(1+Jinterest)^(-months))); /*Monthly payment*/
         float Minterest = principle * Jinterest; /*This months interest*/
         float Mprinciple = calculation - Minterest; /*This months principle*/
         float newBalance = principle - Mprinciple; /*This calculates the new principle*/
         if (newBalance = princple) {
              System.out.print("You have paid off your loan");
         else
              System.out.print("This months payment is: $", calculation); /*Displays the current months payment*/
              System.out.print("You have $", newBalance," left on your loan"); /*Displays the new principle balance*/
              System.out.print("This months principle is: $", Mprinciple ); /*Displays the new principle balance*/
    }

    It is in my post at 10:02, but here it is again:
    These are the errors that I am left with. I worked through the rest.
    .java:29: '.class' expected
    months = myScanner.next(int);
    ^
    .java:29: ')' expected
    months = myScanner.next(int);
    ^
    2 errors
    Tool completed with exit code 1
    import java.util.Scanner;
    import java.io.*;
    import java.text.*;
    public class Week2Assignment
    int principle = 200000;
    double  interest = .0575;
    int term = 30;
    int months;
    float paymentdue;
    float calculation;
    public void months()
    Scanner myScanner = new Scanner(System.in);
       System.out.print("What month of the loan is this?" + months);
    if (months == term) {
       System.out.print("You have paid off your loan");
    else
         months = myScanner.next(int);
         double Jinterest = (interest / (months*100));
         calculation = principle * (Jinterest/(1-(1+Jinterest)^(-months))); /*Monthly payment*/
         float Minterest = principle * Jinterest; /*This months interest*/
         float Mprinciple = calculation - Minterest; /*This months principle*/
         float newBalance = principle - Mprinciple; /*This calculates the new principle*/
         if (newBalance == princple) {
                 System.out.print("You have paid off your loan");
         else
                 System.out.print("This months payment is: $", calculation); /*Displays the current months payment*/
                 System.out.print("You have $", newBalance," left on your loan"); /*Displays the new principle balance*/
                 System.out.print("This months principle is: $", Mprinciple ); /*Displays the new principle balance*/
    }

  • Need java 1.6.0_4 for SQL developer 3.2 64bit, Win 7

    Hi All
    I Need java 1.6.0_4 for SQL developer 3.2 64bit, Win 7.
    SQL developer behaves weirdly sometimes. It frequently drops connection, doesn;t show compile button when i open a procedure and certain other things.... I found ver 3.0 quiet stable.
    I think it may be because of my incorrect java version (1.6.0). Please tell me how can I get this Java version 1.6.0_4. I checked oracle.com, version 35 is available there....
    Can you please help me by providing this ?
    Thanks

    >
    I Need java 1.6.0_4 for SQL developer 3.2 64bit, Win 7.
    I think it may be because of my incorrect java version (1.6.0). Please tell me how can I get this Java version 1.6.0_4.
    Can you please help me by providing this ?
    >
    No - we can't provide it. You have to download it yourself. If you have trouble with the download you should report the problem to Oracle.
    >
    I checked oracle.com, version 35 is available there....
    >
    If you checked at the Java SE Downloads page
    http://www.oracle.com/technetwork/java/javase/downloads/index.html
    Then you should have seen the 'Previous Releases' link jus above the download Icons near the top of the page.
    http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html#jre-6u1-oth-JPR
    All of the available prior versions are available at that link.
    But I strongly suggest you heed the advice given to use the latest 1.6 version of Java available unless you have a very good reason not to.

  • Oracle reports developer 11g java.lang.NoClassDefFoundError oracle/xml/parser/v2/XMLParserException

    Hi All,
    Need expertise help to resolve the issue I am getting with Oracle Report builder.
    I have installed and configured Oracle Forms and Reports Builder 11g  on my Windows 7 & 64 bit machine.
    Oracle Forms are working fine and I am getting an error while I am launching the Oracle Report Builder.
    It says
    The error is;
    java.lang.NoClassDefFoundError:
    oracle/xml/parser/v2/XMLParserException
    once I close th eabove error window, then it says java.lang.NullPOinterException.
    I have done all modifications to Middleware\as_1\bin rwbuilder.bat file as below
    @echo off
    @echo INFO: The Reports Builder is only supported on the Linux x86 and Windows x86 operating systems, for further information, please refer to the Release Notes ...
    @echo Starting Reports 11g Builder...
    setlocal
    call C:\Oracle\Middleware\asinst_1\config\reports\bin\reports.bat
    @echo on
    start C:\Oracle\Middleware\as_1\bin\rwbuilder.exe %*
    @echo off
    endlocal
    :end
    @echo on
    But report builder is not working. (Error comes when launching the Report Builder ).
    Quick support is highly appreciated.
    Thanks
    Muditha

    Hi All,
    Need expertise help to resolve the issue I am getting with Oracle Report builder.
    I have installed and configured Oracle Forms and Reports Builder 11g  on my Windows 7 & 64 bit machine.
    Oracle Forms are working fine and I am getting an error while I am launching the Oracle Report Builder.
    It says
    The error is;
    java.lang.NoClassDefFoundError:
    oracle/xml/parser/v2/XMLParserException
    once I close th eabove error window, then it says java.lang.NullPOinterException.
    I have done all modifications to Middleware\as_1\bin rwbuilder.bat file as below
    @echo off
    @echo INFO: The Reports Builder is only supported on the Linux x86 and Windows x86 operating systems, for further information, please refer to the Release Notes ...
    @echo Starting Reports 11g Builder...
    setlocal
    call C:\Oracle\Middleware\asinst_1\config\reports\bin\reports.bat
    @echo on
    start C:\Oracle\Middleware\as_1\bin\rwbuilder.exe %*
    @echo off
    endlocal
    :end
    @echo on
    But report builder is not working. (Error comes when launching the Report Builder ).
    Quick support is highly appreciated.
    Thanks
    Muditha

  • Moving from Oracle to SAP--need your help

    Dear All SAP Professionals
    I have 6 years experience in Oracle Development (forms&reports); and i intend to start my new path with sales and distribution in SAP ERP v.6.
    So i need your help where to start? which tutorials & docs? , and i want to study also ABAP
    Regards
    Mohamed 3amer

    >
    Julius Bussche wrote:
    > Alternately you can ask a few hundred basic interview questions in the forums and see how others like it...
    >
    Hmmm.

  • Need urgent help regarding oracle 8.0

    Hi Guys!!
    This is vishal, and i am working as an oracle developer.
    I would appreciate your help if you could help me solving the below
    issue :
    Right now the database on which we are running our applications is
    8.0 version. We have oracle App server on which all of these j2ee
    applications are running.
    basically our client is trying to move large amount of data to a
    new database probably 10G, so my job is to analyse the code and
    do some modifications to the code, give them a solution to upgrade
    it to 10g
    There are like 10 applications running on oracle app server and the
    database has many old tables, and they need a suggestion regarding
    this upgradation/migration.
    And i specifically want to know about the problems faced during the
    upgradation, and how exactly is the upgradation done(step -by -step
    procedure), because i also have to take care of the data which
    has been stored from many years.
    thanks,
    Vishal

    I find these informations in the Upgrade Guide (upgrading of database and of application programs):
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14238/toc.htm
    Note: direct upgrade from 8.0 to 10g is not supported using tools like DBUA (Database Upgrade Assistant).
    Werner

  • I need java on my mac 10.5.8 and it fails to mount each time! Please help!

    I am using an imac 10.5.8 and can't seem to download the java i need to print coupons! Each time I try it fails to mount! Please help!

    The last Java update for Leopard was:
    Update 10, 29 June 2011 - This release updates J2SE 5.0 to 1.5.0_30, and updates Java SE 6 to 1.6.0_26. J2SE 1.4.2 is no longer being updated to fix bugs or security issues and remains disabled by default in this update. Support for out-of-process Java applets on Mac OS X 10.5 Leopard has been removed with this update.
    This release is only for Mac OS X 10.5.8 or later versions of Mac OS X 10.5. http://support.apple.com/kb/DL1359
    and for Snow Leopard:
    http://support.apple.com/kb/DL1360
    Note: Java 1.6 for Leopard is 64 bit only, but for Snow Leopard it is available for both 32 and 64 bit.
    http://www.roguish.com/blog/?p=266
    Since August 2012 updates for Java (and especially Java Runtime Environment, which is what you actually need) must now be downloaded direct from Oracle:
    http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1637588.h tml
    Further information here:
    http://www.oracle.com/us/corporate/press/1735645
    and their FAQ’s:
    http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/mac-faq.html
    However, if you need the Jave 6 JRE and plug-in, MadMAC0 has posted at
    https://discussions.apple.com/message/20107182?ac_cid=tw123456#20107182
    Apple has also posted (Oct 22/12) the approved solution for restoring the Java 6 plug-in:
    Java for OS X 2012-006: How to re-enable the Apple-provided Java SE 6 applet plug-in and Web Start functionality.
    Interesting article here on why Apple removed Mac browsers’ ability to run Jave Applets:
    http://www.techweekeurope.co.uk/news/apple-java-browser-mac-os-x-96827

Maybe you are looking for

  • Including JavaScript in a .js File Referenced by the Page Template

    http://download-uk.oracle.com/docs/cd/B31036_01/doc/appdev.22/b28839/javascript.htm#BCEHEFGF Hi trying to implament Patrick's Library In the above it gives you the following to put into the template header <script src="http://myserver.myport/my_image

  • Inserting Lob value in Oracle

    Hi, I want to know two things *1-* If I insert a lob value say blob through sql stament as shown below insert into employee(id,name,picture) values('101','Peter',pic ); Now how value will insert into Oracle table i.e. lob pointer in original table an

  • Multiple Operation in Service Interface

    Hi Experts, Here is the problem - Scenario:      SOAP Adapter-> PI (7.1) -> XI Adapter -> ERP Proxy We have defined multiple operation in Service Interface using Interface pattern "Stateless". Message posted using SOAP adapter goes through PI alright

  • RAW TO HEX & HEX TO RAW

    Hi, I have one table with one field and datatype of this field is RAW because I want to store data in binary format I insert one record into this table using this command INSERT INTO TEST VALUES(RAWTOHEX('MADHU')); when I am doing SELECT it show all

  • FRFT Bank to Bank Transfer

    have a nagging problem on Bank-to-Bank transfer. I strongly believe, based on you reply to a question related to this problem, that you are the GO-TO guy for my problem. Here is what I am doing:  1. Maintained Repetitive codes using T-code OT81 (payi