How to use triger in jdbc

Could anyone give me a example to show me how to use triger in JDBC, please.
Thanks

JDBC doesn't enter into it. You can find examples and tutorials about triggers with google. Google will even fix the typo "triger" to "trigger" for you :-)

Similar Messages

  • How to use a portal jdbc system to delete or insert by IExecution.execute

    hi everyone:
    I create a jdbc system in portal. Then I use following codes to query a table
    IQuery query = client.newQuery();
    query.execute("SELECT * FROM [Categories]");
    It is fine.
    Now, I wanna do insert or delete operation. I can't use the IQuery object. I think it is only for query and it is Deprecated. I find there is a method: IExecution.execute(IOperation). But I don't know how to use that method. Can I insert/delete records using that method? The last question is how to control the sql transaction by that IExecution object.
    thanks
    elliot

    Hi,
    I followed the interface framework to complete a query.
    The code is shown under
    How to Modify DB Records Using JDBC Connector FrameWork
    But I got this exception and I don't know how to go further:
    com.sapportals.connector.execution.ExecutionException: Exception during execution of SQL statement at com.sapportals.jdbcconnector.execution.objects.JDBCExecution.execute(JDBCExecution.java:118) at iview.Simple.doContent(Simple.java:43) at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209) at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114) at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328) at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136) at

  • How to use setCLOB with JDBC.

    Hi,
    from oracle jdbc document, i know how to use getClob method. but i wonder how to insert a new record included a clob field (setClob). but clob is an interface.
    it seem that it can not be successful to use setclob directly.
    my friend has a way : insert an empty clob into database, then seek this record, and update it with full info again.
    please help me!
    thank in advance.
    wu jianhua.

    A few ways:
    1. Use the LOBs got from a ResultSet, for example,
    Clob x = rs.getClob(1); //you get an oracle.sql.CLOB object
    pstmt.setClob(1, x);
    2. use oracle.sql.CLOB
    public static CLOB empty_lob() throws SQLException;
    creates an empty lob.
    public static BLOB createTemporary(Connection conn, boolean isCached, int
    duration);
    creates temp lob.
    Those methods create object of type oracle.sql.CLOB.
    refer to Oracle jdbc doc for this.

  • How to use third party jdbc drivers ?

    Hi,
    Im new to sun one app server.i have some existing CMP
    bean (currently testing under J2EE RI).database used is
    SQL server 2000 and using a 3 rd party JDBC Driver.
    my question is. if i switch to sun one app server, do i need
    anyother third party stuff to support CMP using SQL
    Server? (other than the exisiting jdbc driver andSQL Server).
    I read somewhere that in sun one we need to get a
    persistance manger from the 3 rd part. is it necessary?
    can i use my plain jdbc driver with the builtin persistance
    manager of sun one app server?. how can i do that ?
    thanks in advance
    -mr ex

    Hi,
    Persistence manager from 3rd party is not required.You
    can use the built in persistence manager of Sun one application server.
    You can refer the following link for creating new persistence manager
    http://docs.sun.com/source/816-7156-10/agj2eres.html#47595
    Get back in case of issues

  • How to use the latest jdbc driver in weblogic61beta?

    weblogic61 comes with mssqlserver4v65.jar,
    currently the latest jdbc driver is mssqlserver4v70sp10
    but seems the license and directory structure is only for
    weblogic51. I tried to use it for weblogic61beta, but it failed.
    please advice. thanks

    here's the stack trace when I tried to use the latest jdbc driver
    other than the one comes with weblogic61beta
    The WebLogic Server did not start up properly.
    Exception raised: java.lang.NoSuchMethodError
    java.lang.NoSuchMethodError
    at weblogic.management.internal.xml.ConfigurationParser$ConfigurationHandler.parseMBeanAttri
    butes(ConfigurationParser.java:300)
    at weblogic.management.internal.xml.ConfigurationParser$ConfigurationHandler.startElement(Co
    nfigurationParser.java:185)
    at weblogic.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1340)
    at weblogic.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:
    1183)
    at weblogic.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1
    862)
    at weblogic.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumen
    tScanner.java:1005)
    at weblogic.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381
    at weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:967)
    at weblogic.management.internal.xml.ConfigurationParser.parse(ConfigurationParser.java:104)
    at weblogic.management.internal.xml.XmlFileRepository.loadDomain(XmlFileRepository.java:261)
    at weblogic.management.internal.xml.XmlFileRepository.loadDomain(XmlFileRepository.java:223)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:587)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:573)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:31
    9)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:437)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:178)
    at $Proxy1.loadDomain(Unknown Source)
    at weblogic.management.AdminServer.configureFromRepository(AdminServer.java:186)
    at weblogic.management.AdminServer.configure(AdminServer.java:171)
    at weblogic.management.Admin.initialize(Admin.java:229)
    at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:354)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:197)
    at weblogic.Server.main(Server.java:35)
    Reason: Fatal initialization exception
    "Jason Chen" <[email protected]> wrote:
    >
    weblogic61 comes with mssqlserver4v65.jar,
    currently the latest jdbc driver is mssqlserver4v70sp10
    but seems the license and directory structure is only for
    weblogic51. I tried to use it for weblogic61beta, but it failed.
    please advice. thanks

  • How to use the oracle jdbc driver

    hi all,
    i have use the jdbc driver for oracle before but this time i<m under a hp-ux system and it seems to be different
    the dba here said the odbc driver and the jdbc driver where install but i get this error when i compile the code
    Class oracle.jdbc.driver.OracleDriver not found in type declration.
    if i try to use a odbc driver i can compile(since the classes are in jdk1.3) but i get this error at run time
    java.sql.SQLException: No suitable driver
    at java.sql.DriverManager.getConnection(Compiled Code)
    at java.sql.DriverManager.getConnection(DriverManager.java:126)
    at TestOracle.<init>(TestOracle.java:33)
    at TestOracle.main(TestOracle.java:126)
    can someone help me out to better understand what is wrong
    it seems the drivers are not install but again the dba assures me they are
    import java.sql.*;
    import java.io.*;
    public class TestOracle {
    public TestOracle()
    // Load the Oracle JDBC driver
    // Connect to the database
    // search the dossiers numbers in the right table depending on criteria
    // if demands comes from extranet verify to only send back the dossier
    // numbers that are linked to the customer
    // Load the Oracle JDBC driver
    try
         //DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
         //Class.forName("oracle.djbc.driver.OracleDriver");
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
    catch( Throwable t ){t.printStackTrace();}
    //SQLException,IOException,ClassNotFoundException,
    //IllegalAccessException,InstantiationException
    try
         // Connect to the database
         // You can put a database name after the @ sign in the connection URL.
         Connection conn =
              //DriverManager.getConnection ("jdbc:oracle:oci8:@COLDDEV", "USER", "PPP");
              DriverManager.getConnection("jdbc:odbc:COLDDEV","USER", "PPP");
         Statement stmt = conn.createStatement ();
         ResultSet r = stmt.executeQuery("select * from Dossier");
         stmt.close();
         System.out.println("trouver:" + r.getString("Dossier_Number"));
    catch (SQLException e){e.printStackTrace();}
    public static void main(String[] args)
    TestOracle testOracle1 = new TestOracle();
    here is the code iuse

    http://forum.java.sun.com/thread.jsp?forum=48&thread=187964&start=0&range=15#608968
    The above link is a comprehensive "How to get set up and on my way" that I made for someone else learning Oracle/jdbc. Kind of a self-help resource page. I would start from the beginning and download the newest drivers, then set up your environment,...etc.
    hope this helped,
    Jamie

  • How to use a cofigured JDBC iView?

    Hello,
    I ghave configured an iView which implements a JDBC connection to my SQLServer, let's call it "myJDBC".
    Can someone please show me a simple code example
    (including relevant descriptors)of another iView which uses the JDBC iView in order to Query the Database and display the results?

    Hi,
    I assume by JDBC iView you mean that you have created a system that points to a database. <i>Not</i> JDBC iView as if you had created one of these you would already be able to configure the output at the time of the iView creation.
    What Praveen has said is correct one way is to do a custom development using JSP. (He makes it sound easy!).
    There are a number of options using the standard iViews provided out of the box rather than getting into java code.
    There are two types that are quite basic but easily configurable.
    They are JDBC Stored Procedure iView & Query iView.
    The stored procedure iView obviously requires a stored procedure on the database that provides a response.
    The iView creation wizard will enable you to be able to browse and select your stored procedure and for the query iView you should be able to select the tables etc and organise there output inside the wizard.
    If you have difficulty when creating these iViews check you configured the system correctly so make sure you follow the steps of:
    Create Alias on the system and Test connection
    Provided usrpwd details to DQE on the system.
    Configured your user mapping to the Alias using the personalize option on the portal header.
    Once you have this all working you might like to look at a bigger challenge and get unification iViews working...
    See Weblog :
    1-2-3 Drag&Relate (or D&R for dummies)

  • How to use ANYDATASET from jdbc (11g)

    Hi, the jdbc dev. guide for 11g doesn't even mention the word ANYDATASET.
    However this data type is listed within the set of 11g jdbc new features.
    I will much appreciate any example about using it, e.i. assuming a schema defines a type containing a ANYDATASET attribute to be managed on the jdbc side.
    Thanks.

    Hi ...
    Yeah BPEL connect from the back end rather than using weblogic, but to change it ... we need to change the code from BPEL side to connect from the weblogic JDBC services.

  • How to use % wildcard in jdbc plz help me

    Hello all,
    try
         PreparedStatement st=dbcon.prepareStatement("select * from stud2  where ename=? ");
    st.setString(1,ename+"%");
    ResultSet rs=st.executeQuery();
    while(rs.next())
    out.println("<td>");
    out.println(rs.getString(2));//this field is for name
    out.println(rs.getString(3));//this is for addresss
    }catch(Exception e){}This code is in servlets,and iam using MS-ACCESS as database.
    in this way iam trying this code , usage of %wild card but iam not getting the right anser, i want the anser if i will type any letter it should search the database and display me all names of that letter
    plz help me solving this problem
    vidya.

    PreparedStatement ps = con.prepareStatement("select blah from blah where blah like ?");
    ps.setString(1, "a%"); // everything that starts with 'a'
    rs = ps.executeQuery();

  • ** How to use TO_DATE function in Stored Proc. for JDBC in ABAP-XSL mapping

    Hi friends,
    I use ABAP-XSL mapping to insert records in Oracle table. My Sender is File and receiver is JDBC. We use Oracle 10g database. All fields in table are VARCHAR2 except one field; this is having type 'DATE'.
    I use Stored procedure to update the records in table. I have converted my string into date using the Oracle TO_DATE function. But, when I use this format, it throws an error in the Receiver CC. (But, the message is processed successfully in SXMB_MONI).
    The input format I formed like below:
    <X_EMP_START_DT hasQuot="No" isInput="1" type="DATE">
    Value in Payload is like below.
    <X_EMP_START_DT hasQuot="No" isInput="1" type="DATE">TO_DATE('18-11-1991','DD-MM-YYYY')</X_EMP_START_DT>
    Error in CC comes as below:
    Error processing request in sax parser: Error when executing statement for table/stored proc. 'SP_EMP_DETAILS' (structure 'STATEMENT'): java.lang.NumberFormatException: For input string: "TO_DATE('18"
    Friends, I have tried, but unable to find the correct solution to insert.
    Kindly help me to solve this issue.
    Kind Regards,
    Jegathees P.
    (But, the same is working fine if we use direct method in ABAP-XSL ie. not thru Stored Procedure)

    Hi Sinha,
    Thanks for your reply.
    I used the syntax
    <xsl:call-template name="date:format-date">
       <xsl:with-param name="date-time" select="string" />
       <xsl:with-param name="pattern" select="string" />
    </xsl:call-template>
    in my Abap XSL.  But, its not working correctly. The problem is 'href' function to import "date.xsl" in my XSLT is not able to do that. The system throws an error. Moreover, it is not able to write the command 'extension-element-prefixes' in my <xsl:stylesheet namespace>
    May be I am not able to understand how to use this.
    Anyway, I solved this problem by handling date conversion inside Oracle Stored Procedure. Now, its working fine.
    Thank you.

  • How to use JDBC Connection Pools in a standalone application?

    Hi, there,
    I have a question about how to use JDBC Connection Pools in an application. I know well about connection pool itself, but I am not quite sure how to keep the pool management object alive all the time to avoid being destroyed by garbage collection.
    for example, at the website: http://www.developer.com/java/other/article.php/626291, there is a simple connection pool implementation. there are three classes:JDBCConnection, the application's gateway to the database; JDBCConnectionImpl, the real class/object to provide connection; and JDBCPool, the management class to manage connection pool composed by JDBCConnectionImpl. JDBCPool is designed by Singleton pattern to make sure only one instance. supposing there is only one client to use connection for many times, I guess it's ok because this client first needs instantiate JDBCPool and JDBCConnectionImpl and then will hold the reference to JDBCPool all the time. but how about many clients want to use this JDBCPool? supposing client1 finishes using JDBCPool and quits, then JDBCPool will be destroyed by garbage collection since there is no reference to it, also all the connections of JDBCConnectionImpl in this pool will be destroyed too. that means the next client needs recreate pool and connections! so my question is that if there is a way to keep pool management instance alive all the time to provide connection to any client at any time. I guess maybe I can set the pool management class as daemon thread to solve this problem, but I am not quite sure. besides, there is some other problems about daemon thread, for example, how to make sure there is only one daemon instance? how to quit it gracefully? because once the whole application quits, the daemon thread also quits by force. in that case, all the connections in the pool won't get chance to close.
    I know there is another solution by JNDI if we develop servlet application. Tomcat provides an easy way to setup JNDI database pooling source that is available to JSP and Servlet. but how about a standalone application? I mean there is no JNDI service provider. it seems a good solution to combine Commons DBCP with JNID or Apache's Naming (http://jakarta.apache.org/commons/dbcp/index.html). but still, I don't know how to keep pool management instance alive all the time. once we create a JNDI enviroment or naming, if it will save in the memory automatically all the time? or we must implement it as a daemon thread?
    any hint will be great apprieciated!
    Sam

    To my knoledge the pool management instance stays alive as long as the pool is alive. What you have to figure out is how to keep a reference to it if you need to later access it.

  • How to use JDBC Lookup in PI 7.1 ?

    Hi,
    Please advise how to use JDBC lookup in message mapping PI 7.1 ? any reference link / document  ?
    I have followed this step below :
    1. Create the external definition for the database table.
    2. Use the external definition (table) in message mapping JDBC Lookup.
    But the target still "Yellow colour" meanint the mapping hasnot completed yet ? why ? and when i double click the JDBC lookup
    there some error message
    "No suitable parameter found; define new parameter of type 'Channel' first"
    Please advise.
    Thank You and Best Regards
    Fernand

    Hi Fernand,
    JDBC Lookup can be done in PI 7.1 using below mentioned steps :
    1) Create a communication channel between PI and the database to connect to database.
    2) Import the table data as External Definition.
    3) In message mapping where this lookup is to be used select JDBC Lookup under Conversions and map
    4) Double Click on JDBC Lookup
    5) Select parameter and a database table (imported as the external definition). All the elements of the table will appear in the middle column. Select and move the input parameters to the left side column and the output parameters to the right side column. Click OK. 
    6) Under message mapping go to signature tab and define the parameter as channel and category as JDBC Adapter Type. 
    7) Under Operation mapping define the parameter & associate it with parameter defined in Message Mapping.
    Thanks
    Amit

  • How to use oracle collection type with JDBC?

    I try to use oracle collection type in java program. So I made some package and java program, however Java program was not found "package.collectiontype"(JDBC_ERP_IF_TEST.NUM_ARRAY) . please, show me how to use this.
    Java Version : Java 1.4
    JDBC Driver : Oracle Oci Driver
    DB: Oracle 9i
    No 1. Package
    ===========================================
    create or replace package JDBC_ERP_IF_TEST AS
    type NUM_ARRAY is table of number;
    procedure JDBC_ERP_IF_ARRAY_TEST(P_NUM_ARRAY IN NUM_ARRAY, ERR_NO OUT NUMBER, ERR_TEXT OUT VARCHAR2);
    procedure TEST(ABC IN NUMBER);
    END JDBC_ERP_IF_TEST;
    ==================================================
    No 2. Package Body
    ===============================================
    CREATE OR REPLACE package BODY JDBC_ERP_IF_TEST is
    procedure JDBC_ERP_IF_ARRAY_TEST(p_num_array IN NUM_ARRAY,
    ERR_NO OUT NUMBER,
    ERR_TEXT OUT VARCHAR2) is
    begin
    ERR_NO := 0;
    ERR_TEXT := '';
    dbms_output.enable;
    for i in 1 .. p_num_array.count() loop
    dbms_output.put_line(p_num_array(i));
    insert into emp (empno) values (p_num_array(i));
    commit;
    end loop;
    EXCEPTION
    WHEN OTHERS THEN
    ERR_NO := SQLCODE;
    ERR_TEXT := ERR_TEXT ||
    ' IN JDBC INTERFACE TEST FOR ORACLE ERP OPEN API..';
    ROLLBACK;
    RETURN;
    end JDBC_ERP_IF_ARRAY_TEST;
    procedure TEST(ABC IN NUMBER) IS
    begin
    insert into emp(empno) values (ABC);
    commit;
    end TEST;
    end JDBC_ERP_IF_TEST;
    ===============================================
    NO 3. Java Program
    ===============================================
    ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor("JDBC_ERP_IF_TEST.NUM_ARRAY", getConnection());
    ARRAY array = new ARRAY(descriptor, getConnection(), arrs);
    cstmt = getConnection().prepareCall(LQueryFactory.getInstance().get("Meta/Basic/testJdbcErpArrayIf").getSql());
    cstmt.setArray(1, array);
    cstmt.registerOutParameter(2, Types.INTEGER);
    cstmt.registerOutParameter(3, Types.VARCHAR);
    ====================================================
    couldn't find this phase => JDBC_ERP_IF_TEST.NUM_ARRAY
    what can i do for this package and program? please help me..

    Something like this:
    create or replace type t_record as  object (
    id number,
    no number
    CREATE or replace type t_table AS TABLE OF t_record;
    set serveroutput on
    declare
      v_table t_table := t_table();
      v_t1 t_table := t_table();
    begin
      v_table.extend(1);
      v_table(1).ID := 1;
      v_table(1).No := 10;
      v_table.extend(1);
      v_table(2).ID := 2;
      v_table(2).ID := 20;
      SELEC t_record (ID,NO) BULK COLLECT INTO v_t1
      from TableA
      FROM TABLEA
      WHERE ID IN (select t.ID from table(v_Table) t);
      for i in 1..v_t1.count loop
        dbms_output.put_line(v_t1(i).ID);
        dbms_output.put_line(v_t1(i).No);
      end loop;
    end;
    /Untested!
    P;
    Edited by: bluefrog on Mar 5, 2010 5:08 PM

  • How to use a jdbc driver in caf

    Hi, all.
         I tried to make a ws to access DB with CAF, but I had no idea how to use a jdbc driver(.jar).
        Can anyone do me a favor? Thx 
        PS: my server is ce7.1
    Edited by: Louis HUANG on Jul 27, 2009 1:09 PM

    hi
    If you want to interact with db tables in caf,try like this.
    it may work..
    Using EJB call database tables using jdbc driver.
    Expose EJB as webservice.
    and using External service option of caf utilise this webservice in caf,do the necessary mappings..
    you can search in sdn,how to call DB tables in EJB..
    Regards
    sowmya.

  • How to use Stored Procedures in Sender JDBC Adapter.

    Hi Experts,
        we are having a lot of legacy application which are on .Net. basicaly using MS SQL & stuff. As a Integration scenario we have to triggered some events from JDBC to XI. How can i do this. Secondly there are multiple tables from which i will be selecting a record & sending it to XI for further processing the Receiver Side we are having SAP system.
        How can i use a Stored procedure in XI Sender Adapter ?
        Can anybody tell me step by step how to get the XSD of Stored procudere & used in XI. ?
         I am new to XI. I have not yet configured any sceneario.
         Can anybody guide me step by step how to do this.
         I am only intersted in Sender Side configuration.
    Regards,
    Umesh

    Hey,
    check this in the JDBC Sender Adapter Configuration
    Query SQL Statement -> Specify an SQL EXECUTE statement to execute a stored procedure, which contains exactly one SELECT statement.
    The expression must correspond to the SQL variant supported by the relevant JDBC driver. It can also contain table JOINs.
    http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
    JDBC adapter
    /people/saravanakumar.kuppusamy2/blog/2005/01/19/rdbms-system-integration-using-xi-30-jdbc-senderreceiver-adapter
    <b>Cheers,
    *RAJ*
    *REWARD POINTS IF FOUND USEFULL*</b>

Maybe you are looking for