Can a java code interact with trigger

Hi guyz ,
is there any way by which a trigger can interact with JDBC ?
I want to check the database each time its updated and if some condition is violated , the info((row from table which has voilated some rule) is passed to java code which can then take necessary action . Can anyone help me out in this because i am not aware of any way by which a trigger can interact with java code .
Regards,
Nikhi

nikhil456123 wrote:
Hi guyz ,
is there any way by which a trigger can interact with JDBC ?
I want to check the database each time its updated and if some condition is violated , the info((row from table which has voilated some rule) is passed to java code which can then take necessary action . Can anyone help me out in this because i am not aware of any way by which a trigger can interact with java code .Note that even though it might be possible you might want to consider that it isn't necessarily a good idea.
Say the action is "send email". Then every time an insert/update/delete occurs then an email is sent. That would obviously slow down those operations a lot. Not to mention that if 1000 inserts occur then someone is going to get 1000 emails.
There can be alternatives that are much better.

Similar Messages

  • Can Enterprise Java Beans interact with any database system

    Hello:
    I was wondering if someone can tell me if the Enterprise javabeans can work with any database (like multi-valued database for example Universe)?
    Thanks in advance.
    Rino

    Yes

  • Pacman frontend in Java - Howto interact with alpm

    I plan to write a(nother :-) ) GUI frontend to Pacman using Java + Swing.  However I need some advice regarding how should I interact with Pacman.
    Basically my requirements are:
    1.  Reading/Searching package database
    2.  Showing a download progress bar
    3.  Showing a progress bar when Pacman is installing/removing package(s)
    As 'alpm' is a C library it's not easily accessible from Java.  The only and perhaps dummest solution that I can think of is to write my own pseudo-alpm library to handle the requirements but I'd seriously rather avoid the re-work and bugs of such a process.  Is there any other way?
    I'd appreciate any idea/hint.  TIA,
    Bahman

    If you have some success creating jni bindings to libalpm you might consider creating an AUR package to join the lua, perl and python packages that are there now.

  • Using java to interact with a website

    I'm looking to build a program that will function as an alternate front end for an online database so that users can perform batched operations. Is there a way to have java navigate and interacte with a website? This would be something a macro would do, except that I need to be able to interact with the desktop, among other things. Also, I'm stuck with internet explorer, as the IT people don't want Firefox on any of the machines, so that excludes the iMacros add on.
    anyone got an idea? thanks

    DrClap wrote:
    Unless you also control the website. However, even in that case I think that web services are superior in the long run to HTML-scraping.Agreed. I was assuming that if the website was one's own, one wouldn't resort to scraping, but you're right, that needs to be stated.

  • Java and interaction with system mouse events

    I would like my Java app to be notified of all Mouse events (primarily clicks is what I am interested in) even when they occur outside the java app or when java app is not the focus. For example the user may be clicking on the File menu of Microsoft Word. I'd like to know that a mouse click occured at x,y coordinate when that happens.
    Can this be done with Java API or is there a need for native code that talks to the OS (Windows and OS X) directly, which should be called with Java Native Interface?
    I would appreciate any pointers in the right direction.

    Hi,
    I'm also trying to find a way of intercepting mouse clicks when they occur outside java components.
    The code for getting the pointer location from the desktop is:
    import java.awt.*;
    public class MouseLocation
         private MouseInfo mInfo;
         private PointerInfo pInfo;
         private Point point = new Point();
         private int buttons = 0;
         private double pointX = 0d;
         private double pointY = 0d;
         private Robot robot;
         public MouseLocation()
              try
              {     robot = new Robot();     }
              catch(Exception e)     {     }
              hasMouse();     
              pointerLocation();
         }//ends constr.
         private void hasMouse()
              buttons = mInfo.getNumberOfButtons();
              if(buttons == -1)
                   System.out.println("No mouse detected.  Program terminated.");     
                   System.exit(0);     
         }//ends hasMouse()
         private void pointerLocation()
              try
                   pInfo = mInfo.getPointerInfo();
                   point = pInfo.getLocation();
                   pointX = point.getX();
                   pointY = point.getY();
                   System.out.println("pointer is at: (" + (int)pointX + ", " + (int)pointY + ")");
                   delay();
              catch(HeadlessException he)     
                   System.out.println((he.toString()) + ".  Program terminated.");     
                   System.exit(1);
              catch(SecurityException se)     
                   System.out.println((se.toString()) + ".  Program terminated.");     
                   System.exit(1);
         }//ends pointerLocation()
         public String getPointerLocation()
         {     return (point.toString());     }//ends getPointerLocation()
         public void delay()
              try
                   robot.delay(6000);     
                   pointerLocation();
              catch(Exception e)     {     }
         }//ends delay()
         public static void main(String[] args)
              MouseLocation ml = new MouseLocation();
         }//ends
    }//ends class MouseLocation

  • Can JDBC3.0 code coexist with J2SE 1.4 ?

    I am working on a large project that currently is deployed on J2SE 1.3.1.
    One class implements java.sql.Connection and, as there are new methods
    on the Connection interface in J2SE 1.4, this class
    won't compile with 1.4.
    I can add the additional methods to MyConnection, but
    there is no separate jdbc.jar for jdbc 3.0 which means
    I can't execute the modified class with J2SE 1.3.
    Am I missing something here?
    Is there really no way the same code that implements java.sql.Connection can run in both 1.3 and 1.4?
    Peter Booth

    The class is a customized connection that works with our own connection pool.
    The problem is that to have the class compile with Java 1.4, I need to implement
    new methods such as the following. The first method works
    fine but the second depends upon the existence of
    java.sql.SavePoint - which would require the Java 1.4
    JDBC classes.
    I am sure I am not the only person encountering this.
    Is there any reason why a JDBC 3 jar isn't available
    as a separate download?.
    public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException
    throw new java.lang.UnsupportedOperationException(
    "MyConnection: Method prepareStatement(String , String[] ) not implemented yet. \nThis is a Java 1.4 method and we're still using Java 1.3.1 in production");
    public void releaseSavepoint(Savepoint savepoint) throws SQLException
    {                                                                                      throw new java.lang.UnsupportedOperationException(  "MyConnection: Method releaseSavepoint(Savepoint ) not implemented yet. \nThis is a Java 1.4 method and we're still using Java 1.3.1");                                       
    }

  • Using java to interact with html.

    I want to create a program that goes to html pages and presses some buttons. where do I look?

    Hi duo,
    please try and use the code snippet i am pasting below.The code is accessing a page and then submitting a form on the page by making the url in the code itself.
    import java.io.*;
    import java.net.*;
    public class SubmitHTML
         public static void main(String[] args)
              System.out.println("*********** GOING TO ACCESS PAGE START ***********");
              SubmitHTML s1 = new SubmitHTML();
              s1.getHTMLPage();
              System.out.println("*********** GOING TO ACCESS PAGE END ***********");
         private void getHTMLPage()
              //phase 1
              try
                   String str = "";
                   char ch1=(char)0x0d; //\r
                   String strURL = "http://tahiti.oracle.com/pls/tahiti/tahiti.error_search";
                   URL url = new URL(strURL);
                   HttpURLConnection.setFollowRedirects(false);
                   HttpURLConnection urlConn = (HttpURLConnection)url.openConnection();
                   //urlConn.setRequestProperty ("Content-Type", "application/x-www-form-urlencoded");
                   urlConn.setDoInput(true);
                   //urlConn.setUseCaches(false);
                   System.out.println("LOGIN: Reading..." + urlConn.getHeaderField(0));
                   System.out.println("getContentEncoding ..." + urlConn.getContentEncoding());
                   System.out.println("getContent..." + urlConn.getContent());
                   System.out.println("getContentType..." + urlConn.getContentType());
                   BufferedReader br = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
                   String line;
                   boolean flag = false;
                   while((line=br.readLine())!=null) {
                        //System.out.println(line);
                        str = str + line + String.valueOf(ch1);
                   System.out.println("*********** THE FIRST PAGE RETURNED BY GOOGLE IS START ***********");
                   System.out.println(str);
                   System.out.println("*********** THE FIRST PAGE RETURNED BY GOOGLE IS END ***********");
                   String strQuery = "ORA-9989";
                   strURL = "http://tahiti.oracle.com/pls/tahiti/tahiti.error_search?search="+strQuery+"";
                   System.out.println("The url is ::" + str);     
                   url = new URL(strURL);
                   HttpURLConnection.setFollowRedirects(false);
                   urlConn = (HttpURLConnection)url.openConnection();
                   //urlConn.setRequestProperty ("Content-Type", "application/x-www-form-urlencoded");
                   urlConn.setDoInput(true);
                   //urlConn.setUseCaches(false);
                   br = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
                   str = "";
                   while((line=br.readLine())!=null) {
                        //System.out.println(line);
                        str = str + line + String.valueOf(ch1);
                   System.out.println("\n\n\n");
                   System.out.println("*********** THE PAGE RETURNED BY GOOGLE AFTER SUBMITTING START ***********");
                   System.out.println("LOGIN: Reading..." + urlConn.getHeaderField(0));
                   System.out.println("getContentEncoding ..." + urlConn.getContentEncoding());
                   System.out.println("getContent..." + urlConn.getContent());
                   System.out.println("getContentType..." + urlConn.getContentType());
                   System.out.println(str);
                   System.out.println("*********** THE PAGE RETURNED BY GOOGLE AFTER SUBMITTING END ***********");
              catch (Exception e)
    anjani

  • JAVA PJC Interaction with Standard Form Fields?????

    I am creating come sophisticated PJC's using VBean and the various classes provided in f90all.jar. This works great! However my components would be more elegant and easier to use for my application team if the VBeans could access / set the value of a non-PJC form field. Ie., I have a VBean that wants to access a TEXT ITEM that is standard form field. I have not found f90jar javadoc and I imagine that oracle doesn't want to expose it because it is a moving target. However a simple interface to get / set field values without trigger firing would be sweet! Even just a get would solve 80 % of my issues. Is is possible to enumerate the names of the parent containers items and use get/setProperty to do this? If so what are the built-in property names.

    Ben,
    good point made. I'll forward this to teh development team. We are working on exposing Javadocs for the Forms PJCs'
    Frank

  • Java code to show current date & time on PDF

    Hi,
    I have no experience with Java whatsoever and I am hoping somebody out there will be able to help me. Basically we are in the process of uploading all our SOP's to a public share on our Network. Due to regulatory reasons everytime the document is opened it will need to show the current date which will also show when printed. I have adobe 9 pro and see there is a area that you can input Java code so with the power of Java im sure this can be done. Ideally this would be like a watermark across all the page diagonally faded into the background of each page on the PDF.
    Only Valid on Date of Printing
    Date Printed: <Current Date>
    Any help would be much appreciated.

    Are you sure you haven't committed one of the cardinal sins of the Java-ignorant by confusing it with Javascript?

  • Java interaction with websites?

    Hey,
    I'm been learning java for a few months now, and know the basics well, I have written a few small programs, including one which transfers songs from iPod to computer.
    I need some advice on where to start on my next project. Basically I want to make a program which automatically performs tasks in the background on websites, for example listing an item on ebay, or uploading a video to youtube. And I'd also like it to read information from different pages, so that I could maybe gather a database of prices from ebay, or somthing along those lines.
    Which classes could I use java to interact with html?
    Where do I start? :)
    My java vocabulary isn't great yet ;)

    Ryanz wrote:
    Ok ... I'm checking it out at the moment, are there any other maybe simpler ways? Or can somone explain how to get the JAX-WS installed and ready to use with eclipse?Ryanz,there are few things involved here.
    1).First and foremost you need to findout whether if respective website offers you any kind of Web-Services to serve your cause.
    Just as an example eBay offers set of services to serve your cause to know more about this you can visit the below links
    [http://www.xml.com/pub/a/2005/09/28/ebay-metadata-web-services.html]
    [http://developer.ebay.com/community/featured_projects/default.aspx?name=Code%20Samples%20Project]
    Similarly identify whether if respective other focused webservice providers offer any specific services serving your cause.
    2).Analyse their service specifications
    3).Identify and Plan for list of Data Transfer Objects to which we can bind this service
    4).Implement for a Stub (may be using Apache Axis) or use JAX-RPC or use JAX-WS or any other related technologies to implement your Webservice Client.
    Coming back to using tools like Apache Axis,JAX- RPC or JAX-WS.
    you might be intrested in looking towards the below set of turtorials
    [http://www.onjava.com/pub/a/onjava/2002/06/05/axis.html]
    [http://www.ibm.com/developerworks/webservices/library/ws-castor/]
    [http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXRPC.html]
    [http://www.ibm.com/developerworks/edu/j-dw-java-jaxrpc2-i.html]
    [http://java.sun.com/webservices/docs/2.0/tutorial/doc/]
    [http://www.myarch.com/create-jax-ws-service-in-5-minutes]
    It is not nessary that a provider has to provide relvant data in form offering webservices and sometimes they can offer you different specs which could be Like regular Java RMI services or DCOM object or something like Feeds(RSS 2.0/ATOM) for providing Latest updates on your account.I'd say it'd be more work for us to identify what kind of service the provider is provding us and how best make use of it so that we can use the relavant data in our application.
    and believe me in most of the cases only point 4 changes after going through point 1,2 & 3.
    Hope that helps :)
    REGARDS,
    RaHuL

  • Format Java Code with jdeveloper

    Hi Everybody,
    Can anybody tell me How I can Indent Java Code Automatically using JDeveloper 9i.
    It is a facility which is provided in almost all the editor and I believe it should be in jdeveloper also but the problem is I dont know how to go for it.
    I will be very kind to anybody who will solve this problem as this will reduce my lot of unwanted work.
    Regards,
    Amit Jain

    If you're looking for a code beautifier (a tool that can apply a coding style to your source code automatically), try the Jalopy extension. It's an open source code beautifier that is tightly integrated with JDeveloper:
    http://jalopy.sourceforge.net/plugin-jdev.html
    Thanks,
    Brian
    JDev Team

  • Can i write java code in JavaScript function

    I want to call JavaBeans within JavaScript function. Can I do it?
    I have a button in JSP . When the button be clicked,the data be inputted will be checked by JavaScript function. If check is ok, then call a Bean's function to write the data to database.
    Please Help!

    well indeed u can write java code in javascript functions. But probably it will not work the way u want it to.
    when u say that u click a button, it means that some client side action is performed. Now if u wud require a java bean to be called then it means that the server needs to be contacted for the same, and if that has to be done, necessarily the form needs to be submitted.
    U can populate values from a java bean and then the same can be made available to a javascript variable / function when the page is loaded rather than, when the button is clicked.
    What u can do is on click of button u can process [display / calulate..etc ] the information which has already been got by the java bean.
    Kris

  • Clob/blob in java-code stored in database

    Hi!
    I want to write some java-code (CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED...)
    where I want to return an image as blob.
    For doing that I have to initialize the blob in the java-code -correct?
    I see many examples like
    oracle.sql.BLOB.createTemporary(conn, false,oracle.sql.BLOB.DURATION_CALL)
    In PL/SQL there is some similar:
    dbms_lob.createtemporary(lob_loc => xmlclob, cache => TRUE, dur => dbms_lob.SESSION);
    If I have to initialize the blob in the java source, how to do that (using empty_blob, but why using oracle...createTemporary then?)?
    I don't want an connection to an remote database, the java-code will be in the database, so can I call createTemporary without >conn<?
    (Oracle 10gR2, Windows, Linux, AIX)
    The picture will be generated calling other java-code loaded with loadjava.
    The java-source I want to write will be wrapped with PL/SQL.
    Greetings
    Bjørn

    Hi!
    It seems you can do this:
              try {
                   conn = new OracleDriver().defaultConnection();                graphblob = oracle.sql.BLOB.createTemporary(conn, false,oracle.sql.BLOB.DURATION_CALL); // must init
                   System.out.println("Blob is init");
              } catch ( java.sql.SQLException sEx ) {
                   throw new RuntimeException ("No connection", sEx);
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1285601748584
    http://www.unix.org.ua/orelly/oracle/guide8i/ch09_08.htm
    /Bjoern

  • Use of Java Code within the generated XML Forms Stylesheets

    Hello,
    is the use of Java-Code possible with the XSL-Files generated by XML-Forms, as possible in standard XSLs? I know that this would mean a modification.
    kind regards,
    Marco

    Hi Marco,
    I "executed" some java code within XSLs file. I have quoted the word executed because I didn't really run java code, but I used a simply trick that I describe you below.
    Into your XSLs put an iframe which is hided (it has an height of 0 pixel). As src of the iframe put the address of a portal component which execute your code (in my case calculate some PCD URL of some pages into a defined role). As result of component execution, I use the response.write method in order to execute some jscript code, which is able to interact with the HTML generated by XSLs files, for example in my case response.write put the PCD URL into a drop down list placed into the "edit" form.
    This works fine. I don't know if is suitable also for your case, anyway could be a hint, but pay attention to Roland's recommendations.
    Ciao
    Roberto

  • In Struts is it possible to use java code  in jsp?

    in Struts Tag Program in jsp pages is it efficient to use java code? Please explain?

    No issues.. you can use java code... in jsp struts
    based framework..
    SJYou can use Java code as scriptlets in any JSP, but that doesn't mean there are no issues.
    I would say it's a bad idea for the following reasons:
    (1) Scriptlet code is difficult to read when mingled with HTML
    (2) You can't unit test scriptlet code
    (3) It increases the chance that business logic will leak into pages where it doesn't belong.
    Better to use a well-proven tag library like JSTL or the Struts taglibs and keep all scriptlets out of your JSPs.
    %

Maybe you are looking for