JDBC  : key : compareOperation

hi All
I am using the SQL query in the JDBC receiver side using the action      SQL_QUERY.
I have to specify the attribute compareOperation for more than two keys . The key part is as follows :
Key
.....Field1
............compareOperation
....Field2
............compareOperation
And query is
Select * from table1 where Field1 = '$Field1$' and Field2 = '$Field2$'
Instead of Equal-To(=), I want to use the operationg specified in the "_compareOperation_"
Is it possible to specify the compareOperation in the SQL query ?

Hi,
Got it!
Pass the field which contains the operator to the UDF.
Operator field----->UDF--->Access
in UDF let say the parameter name is opr
return "Select * from table1 where Field1 "+ opr +" '$Field1$' and Field2 "+ opr + "'$Field2$' ";
raj.

Similar Messages

  • JDBC key generation

    I have programmed an application that uses oracle db. i need some code to get the db to generate primary key automatically.
    I also need to be able to decrement a quantity value from specific tables e.g when a sale is made
    Thanks

    Like the Access auto-increment facility? In Oracle you can create a sequence:
    CREATE SEQUENCE yourSequenceName
    START WITH x INCREMENT BY y [CACHE z];
    I know you can then do the following in Oracle:
    INSERT INTO TableName (column1, column2, column 3)
    VALUES(youSequenceName.nextval, 'a', 'b');
    But of course this is non-stanadard SQL so I don't know if its much use to you. You could implement it in your java code I suppose. Before inserting a new record, perform a query which retrieves the max value from the Primary Key column, increment this by 1 or whatever and then use this new value in your insert statement.

  • JDBC Receiver Adapter FATAL ERROR

    Hi experts,
    I have a ccBPM to JDBC sync scenario. My Integration Process (IP_Workflow) has a Send Step (Mode = Synchronous, Interface = SIA_Update). This SIA_Update is abstract, synchronous and It´s message type has the following structure:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_Update xmlns:ns0="http://www.test.com.br/bpm">
       <StatementName>
          <dbTableName action="UPDATE">
             <table>PI_FORNECEDORES</table>
             <access>
                <STATUS>E</STATUS>
             </access>
             <key compareOperation="EQ">
                <NAME>Name01</NAME>
             </key>
             <key compareOperation="EQ">
                <NAME>Name02</NAME>
             </key>
          </dbTableName>
       </StatementName>
    </ns0:MT_Fornecedores_Update>
    I´m expecting this structure to generate the following update:
    UPDATE PI_FORNECEDORES SET STATUS = 'E' WHERE NAME = 'Name01' OR NAME = 'Name02'
    At RWB I receive the following error message:
    Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException:
    Error processing request in sax parser:
    Error when executing statement for table/stored proc. 'PI_FORNECEDORES' (structure 'StatementName'):
    java.sql.SQLException: FATAL ERROR document format: invalid level 7' found (structure 'StatementName')
    What is wrong with this scenario?

    Thanks for your response Abhi.
    About "key" field, at SAP Help I found the following: "You can use any number of  elements to formulate your condition." Link: Defining an UPDATE Statement.
    The response structure is as follow:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_Update_Response xmlns:ns0="http://www.test.com.br/bpm">
       <StatementName_response>
          <update_count>10</update_count>
       </StatementName_response>
    </ns0:MT_Fornecedores_Update_Response>
    I´m not sure but I think the problem is at request, not at response because it´s not even updating the database.
    Any other idea?
    Thanks,
    Gabriela

  • JDBC Receiver : Handling NULL return from SELECT query

    Hi All,
    I have a Proxy <-> XI <-> JDBC synchronous scenario. I have designed my message mapping to perform a select query using JDBC receiver adapter. The request message mapping structure at the JDBC end is as follows.
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_Matmvmt_Jdbc_Request xmlns:ns0="http://esag.com/xi/bat/MatMovementRead">
       <StatementSelect>
          <Tablename action="SELECT">
             <Table>MM_DATA</Table>
             <access>
                <SEQNO/>
                <MATERIAL/>
                <UOM/>
                <SOLDQTY/>
                <SAPUPD/>
             </access>
             <key compareOperation="EQ">
                <SAPUPD>N</SAPUPD>
             </key>
          </Tablename>
       </StatementSelect>
    </ns0:MT_Matmvmt_Jdbc_Request>
    The scenario works fine when there are records matching the select condition, but when there are no records matching the select condition (i.e. if there are no record with value SAPUPD = 'N' ) then my response message is returning the empty message strucuture as given below.
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_Matmvmt_Jdbc_Request_response xmlns:ns0="http://esag.com/xi/bat/MatMovementRead">
       <StatementSelect_response/>
    </ns0:MT_Matmvmt_Jdbc_Request_response>
    My requirement is that if there are no records matching the select condition then my response message should look like below.
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_Matmvmt_Jdbc_Request_response xmlns:ns0="http://esag.com/xi/bat/MatMovementRead">
       <StatementSelect_response>
          <row>
             <SEQNO/>
             <MATERIAL/>
             <UOM/>
             <SOLDQTY/>
             <SAPUPD/>
          </row>
       </StatementSelect_response>
    </ns0:MT_Matmvmt_Jdbc_Request_response>
    Note : I have made the occurence of the request and response message elements as miniccurs = 0 and maxoccurs = 1.
    Any inputs in this regard will be highly appreciated.
    Regards,
    Sandeep

    Hi Sandeep,
    you can not expect structure like <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_Matmvmt_Jdbc_Request_response xmlns:ns0="http://esag.com/xi/bat/MatMovementRead">
       <StatementSelect_response>
          <row>
             <SEQNO/>
             <MATERIAL/>
             <UOM/>
             <SOLDQTY/>
             <SAPUPD/>
          </row>
       </StatementSelect_response>
    </ns0:MT_Matmvmt_Jdbc_Request_response>
       if there is no data in table. The response which you are geting is standard format which you can not change. Instead you map this response with mapwithdefault node function while mapping to target to make the response mapping success, even though there is no data in response message.
    thanks,
    madhu

  • JDBC SSL connection to Oracle

    Hi All,
    I have been trying to connect to Oracle using a self signed certificate from a simple Java class. I am getting the below error.
    main, handling exception: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    main, SEND TLSv1 ALERT: fatal, description = handshake_failure
    I have searched many forums but couldnt find the information of my help.
    Below are the steps I have followed as per the documentation in wp-oracle-jdbc-thin-ssl-130128.pdf.
    First Step: Created a self signed certificate and a truststore with the below commands using JDK 1.6.0_16
    Create a Keystore:
    keytool -genkey -keyalg RSA -alias MyKey -keystore keystore.jks -validity 360
    Extracting the public key:
    keytool -export -rfc -alias MyKey -keystore keystore.jks -file public.cert
    Creating the Truststore:
    keytool -import -alias MyKey -file public.cert -storetype JKS -keystore keystore.truststore
    Second Step: Added the following in listener.ora and sqlnet.ora
    listerner.ora :
    # listener.ora Network Configuration File: D:\oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora
    # Generated by Oracle configuration tools.
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = CLRExtProc)
    (ORACLE_HOME = D:\oracle\product\11.2.0\dbhome_1)
    (PROGRAM = extproc)
    (ENVS = "EXTPROC_DLLS=ONLY:D:\oracle\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    SSL_CLIENT_AUTHENTICATION = FALSE
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCPS)(HOST = localhost)(PORT = 2484))
    ADR_BASE_LISTENER = D:\oracle
    WALLET_LOCATION =
    (SOURCE =
    (METHOD = FILE)
    (METHOD_DATA =
    (DIRECTORY = E:\misc\Secure-jdbc\OracleCertificates)
    sqlnet.ora :
    # sqlnet.ora Network Configuration File: D:\oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\sqlnet.ora
    # Generated by Oracle configuration tools.
    ENCRYPTION_WALLET_LOCATION =
    (SOURCE =
    (METHOD = FILE)
    (METHOD_DATA =
    (DIRECTORY = E:\misc\Secure-jdbc\OracleCertificates)
    # This file is actually generated by netca. But if customers choose to
    # install "Software Only", this file wont exist and without the native
    # authentication, they will not be able to connect to the database on NT.
    SQLNET.AUTHENTICATION_SERVICES= (BEQ, TCPS, NTS)
    NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
    SSL_CLIENT_AUTHENTICATION = FALSE
    WALLET_LOCATION =
    (SOURCE =
    (METHOD = FILE)
    (METHOD_DATA =
    (DIRECTORY = E:\misc\Secure-jdbc\OracleCertificates)
    ADR_BASE = D:\oracle\product\11.2.0\dbhome_1\log
    Third Step: Created an empty auto logon wallet and added the above created certificate as a Trusted Certificate. (Imported the .cert file into the Trusted Certificates section in Wallet Manager)
    Fourth Step: Used the below Java code to connect to the database using the truststore
    public static void main(String[] args) { try { Class.forName("oracle.jdbc.driver.OracleDriver"); String url = "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=localhost)(PORT=2484))(CONNECT_DATA=(SERVICE_NAME=ORCL11)))"; Properties props = new Properties(); props.setProperty("user", "system"); props.setProperty("password", "oracle"); props.setProperty("javax.net.ssl.trustStore","E:\\misc\\Secure-jdbc\\Keys and Certificates\\keystore.truststore"); props.setProperty("javax.net.ssl.trustStoreType","JKS"); props.setProperty("javax.net.ssl.trustStorePassword","sudhir123#"); Connection conn=DriverManager.getConnection(url,props); System.out.println("conn:"+conn); conn.close(); } catch(Exception e) { e.printStackTrace(); } }
    Any help would be appreciated.
    Thanks.
    Edited by: user10569290 on 20-Feb-2013 22:02

    Hi EJP,
    Please find the below code changes I have done to set the properties as part of System properties instead of Connection properties. I am still getting the same error.
    Code:
    Class.forName("oracle.jdbc.driver.OracleDriver");
              String url = "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=localhost)(PORT=2484))(CONNECT_DATA=(SERVICE_NAME=ORCL11)))";
              Properties systemProps = System.getProperties();
              systemProps.put("javax.net.ssl.trustStore","E:\\misc\\Secure-jdbc\\Keys and Certificates\\keystore.truststore");
              systemProps.put("javax.net.ssl.trustStoreType","JKS");
              systemProps.put("javax.net.ssl.trustStorePassword","sudhir123#");
              System.setProperties(systemProps);
              Properties props = new Properties();
              props.setProperty("user", "system");
              props.setProperty("password", "oracle");
              /*props.setProperty("javax.net.ssl.trustStore","E:\\misc\\Secure-jdbc\\Keys and Certificates\\keystore.truststore");
              props.setProperty("javax.net.ssl.trustStoreType","JKS");
              props.setProperty("javax.net.ssl.trustStorePassword","sudhir123#");
              Connection conn=DriverManager.getConnection(url,props);
             System.out.println("conn:"+conn);
             conn.close();Please find the below output with the SSL debug enabled.
    adding as trusted cert:
    Subject: CN=Sudhir Reddy, OU=FCDMS, O=3i, L=Hyd, ST=AP, C=IN
    Issuer: CN=Sudhir Reddy, OU=FCDMS, O=3i, L=Hyd, ST=AP, C=IN
    Algorithm: RSA; Serial number: 0x511e1ebc
    Valid from Fri Feb 15 17:10:44 GMT+05:30 2013 until Mon Feb 10 17:10:44 GMT+05:30 2014
    trigger seeding of SecureRandom
    done seeding SecureRandom
    %% No cached client session
    *** ClientHello, TLSv1
    RandomCookie: GMT: 1361369602 bytes = { 14, 223, 155, 241, 143, 72, 188, 240, 205, 158, 201, 133, 217, 192, 95, 82, 61, 244, 93, 100, 12, 9, 232, 164, 116, 206, 30, 142 }
    Session ID: {}
    Cipher Suites: [SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_DES_CBC_SHA, SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA]
    Compression Methods: { 0 }
    main, WRITE: TLSv1 Handshake, length = 73
    main, WRITE: SSLv2 client hello message, length = 98
    main, received EOFException: error
    main, handling exception: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    main, SEND TLSv1 ALERT: fatal, description = handshake_failure
    main, WRITE: TLSv1 Alert, length = 2
    main, called closeSocket()
    main, called close()
    main, called closeInternal(true)
    java.sql.SQLRecoverableException: IO Error: Remote host closed connection during handshake
         at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:466)
         at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:535)
         at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:218)
         at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:29)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
         at java.sql.DriverManager.getConnection(DriverManager.java:582)
         at java.sql.DriverManager.getConnection(DriverManager.java:154)
         at SecureJDBC.getSecureConnection(SecureJDBC.java:52)
         at SecureJDBC.main(SecureJDBC.java:15)
    Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:808)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1096)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:623)
         at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:59)
         at oracle.net.ns.Packet.send(Packet.java:421)
         at oracle.net.ns.ConnectPacket.send(ConnectPacket.java:170)
         at oracle.net.ns.NSProtocol.connect(NSProtocol.java:302)
         at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1407)
         at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:328)
         ... 8 more
    Caused by: java.io.EOFException: SSL peer shut down incorrectly
         at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:333)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:789)
         ... 16 more

  • How to use a MAP whithout join table

    Hello
    I am still evaluating KODO ;-)
    I am using kodo 3.1.2 with an evaluation version
    linux (kernel 2.6)
    SUN JDK 1.4.2_04
    MYSQL MAX 4.0.18 -Max
    IDEA 4.0.3 and ANT 1.5.4 (to be exhaustive)
    I am wondering how to configure the following mapping involving a Map. :
    public class Translation {
    private String locale;
    private String txt;
    public class TranslatableDescription {
    /**Map of Key=locale as String; Value = {@link Translation}*/
    ==> private Map translations = new HashMap(); <==
    public void addATranslation(Translation t){
    translations.put(t.getLocale(), t);
    file package.jdo :
    <?xml version="1.0"?>
    <jdo>
    <package name="data">
    <class name="Translation"/>
    <class name="TranslatableDescription">
    <field name="translations">
    <map key-type="java.lang.String"
    value-type="tutorial.data.Translation"/>
    <extension vendor-name="kodo" key="jdbc-key-size" value="10"/>
    </field>
    </class>
    </package>
    </jdo>
    The default Mapping generate a join table : TRANS_TRANSLATION which works
    fine, but I would like to remove this table by adding a
    colonne in the "TRANSLATION" table containing the JDOID of the
    TRANSLATIONDESCRIPTION owner of this TRANSLATION.
    I have made some try like this one in the mapping file
    <class name="TranslatableDescription">
    <field name="translations">
    <jdbc-field-map type="n-many-map" key-column="LOCALE"
    ref-column.JDOID="OWNERJDOID" table="TRANSLATION0"
    value-column.JDOID="JDOID"/>
    </field>
    The schema generated in my DB is correct but when I try to persist some
    objects I have the following Exception :
    727 INFO [main] kodo.jdbc.JDBC - Using dictionary class
    "kodo.jdbc.sql.MySQLDictionary" (MySQL 4.0.18'-Max' ,MySQL-AB JDBC Driver
    mysql-connector-java-3.0.10-stable ( $Date: 2004/01/13 21:56:18 $,
    $Revision: 1.27.2.33 $ )).
    Exception in thread "main" kodo.util.FatalDataStoreException: Invalid
    argument value, message from server: "Duplicate entry '2' for key 1"
    {prepstmnt 8549963 INSERT INTO TRANSLATION0 (JDOID, LOCALESTR, OWNERJDOID)
    VALUES (?, ?, ?) [reused=0]} [code=1062, state=S1009]
    NestedThrowables:
    com.solarmetric.jdbc.ReportingSQLException: Invalid argument value,
    message from server: "Duplicate entry '2' for key 1" {prepstmnt 8549963
    INSERT INTO TRANSLATION0 (JDOID, LOCALESTR, OWNERJDOID) VALUES (?, ?, ?)
    [reused=0]} [code=1062, state=S1009]
    java.sql.BatchUpdateException: Invalid argument value, message from
    server: "Duplicate entry '2' for key 1"
         at kodo.jdbc.sql.SQLExceptions.getFatalDataStore(SQLExceptions.java:42)
         at kodo.jdbc.sql.SQLExceptions.getFatalDataStore(SQLExceptions.java:24)
         at kodo.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:594)
         at
    kodo.runtime.DelegatingStoreManager.flush(DelegatingStoreManager.java:152)
         at
    kodo.runtime.PersistenceManagerImpl.flushInternal(PersistenceManagerImpl.java:964)
         at
    kodo.runtime.PersistenceManagerImpl.beforeCompletion(PersistenceManagerImpl.java:813)
         at kodo.runtime.LocalManagedRuntime.commit(LocalManagedRuntime.java:69)
         at
    kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:542)
         at
    tutorial.CreateTranslatableDescription.main(CreateTranslatableDescription.java:48)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
    I have the feeling that KODO does try to make diffent row in the table
    "TRANSLATION0" for the TRANSLATION and the MAP.
    So, is this kind of mapping supported by KODO and if yes, how can I
    configure it.
    Thank you for your help
    Nicolas

    So, is this kind of mapping supported by KODO and if yes, how can I
    configure it.It is not directly supported. You can fake it using a one-many mapping
    (see thread: Externalizing Map to Collection of PC), but unless you must
    map to an existing schema, it's probably not worth the effort. (Note:
    also there is a bug that actually prevents this from working with 3.1.2;
    the bug is fixed for 3.1.3, but it hasn't been released yet).

  • Value key field in XML for JDBC scenario

    Hi All,
    I am working on RFC to JDBC scenario.
    I have one table in Oracle DB (like mara in sap).
    I wants to read whole data through JDBC adapter.
    I am doing following mapping:
    '1'         -  SELECT
    'SELECT'    -  @action
    access
    <tablename> -  table
    ''          -  <fields1...n>
    key
    ????        -  <key field1>
    Q1) Pls suggest what value i give in key field to
        select all records from DB????
    Q2) Pls suggest what value i give in key field to
        select records with db_field1<> ''????
    Regards

    Thanks for reply.
    But I am not clear How/Where to add optional attributes with key element?
    Or
    I give key_field name as <field_name compareOperation=”NEQ”>
    Pls help in that.
    "The XML elements in the <key>elements can have the following optional attributes:
    compareOperation= <compareType>"
    Regards

  • JDBC Adapter : no key element found

    Hi experts,
    while going through my Idoc to JDBC scenario, I am facing the following problem :
    when I send an Idoc, in the RWB, it goes through the integration engine with no problem, but once in the adapter engine I got the following error:
    Unable to execute statement for table or stored procedure. 'TBL_IN_TCLIENT' (Structure 'Statement1') due to java.sql.SQLException: FATAL ERROR document format: structure 'Statement1', no key element found
    I have no idea where this could come from. My mapping works fine, my tests configuration as well.
    Does anyone know where this might come from ?
    Thanks,
    Regards,
    Jamal

    Here is the xml of my target message type (hope its explicit):
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://pomona/xi/in/ET/VT433_CLIENT_POUR_ET" targetNamespace="http://pomona/xi/in/ET/VT433_CLIENT_POUR_ET">
    <xsd:element name="MT_VT433_CLIENT_SAP_ET" type="DT_VT433_CLIENT_SAP_ET"></xsd:element>
    <xsd:complexType name="TBL_IN_ADV">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    8c900f31649c11ddb2650050568b4d2e
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:sequence>
    <xsd:element name="table" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    4a23cd40589311ddc780001b387a26b0
    </xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="access">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    0f0f64d157e411ddc522001b387a26b0
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="Code" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    d34ec57058b611ddb303001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    numéro de client
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="OC" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    0f0f64d257e411dda5c3001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    orga. com.
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="Canal" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    0f0f64d357e411dd87ab001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    canal de distribution
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="SA" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    0f0f64d457e411dd8fd4001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    secteur d&apos;activité
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="Branche" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    0f0f64d557e411ddc175001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    branche
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="TGR" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    0f0f64d657e411dd94f5001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    niveau de TGR
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="GPV" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    0f0f64d757e411dda36d001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    groupe de vendeur
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="GPV2" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    0f0f64d857e411dd8110001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    libellé groupe de vendeur
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="Agence" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    0f0f64d957e411ddc186001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    agence commerciale
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="Promo_Reg" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    0f0f64da57e411dda201001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    type de promo régionale
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="action" type="xsd:string" use="required">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    0f0f64d057e411ddaff8001b387a26b0
    </xsd:appinfo>
    </xsd:annotation>
    </xsd:attribute>
    </xsd:complexType>
    <xsd:complexType name="TBL_IN_TCLIENT">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    8c925922649c11dd88a20050568b4d2e
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:sequence>
    <xsd:element name="table" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    1be8ae6157d411ddcd78001b387a26b0
    </xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="access">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    1be8ae6257d411ddbca7001b387a26b0
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="Code" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    1be8ae6357d411ddc0dc001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    numéro de client
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="Nom" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    1be8ae6457d411ddabb0001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    nom
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="Ville" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    1be8ae6557d411dd9371001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    localité
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="CP" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    1be8ae6657d411dda83c001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    code postal
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="Adresse" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    1be8ae6757d411dd932a001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    rue et numéro de rue
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="KATR1" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    1be8ae6857d411dd8bae001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    attribut 1
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="KATR1T" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    1be8ae6957d411dd973d001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    désignation attribut 1
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="KATR2" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    1be8ae6a57d411dd8441001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    attribut 2
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="KATR2T" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    1be8ae6b57d411ddcffd001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    désignation attribut 2
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="KATR3" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    1be8ae6c57d411ddb64e001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    attribut 3
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="KATR3T" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    1be8ae6d57d411ddc982001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    désignation attribut 3
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="KATR4" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    1be8ae6e57d411dd85f3001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    attribut 4
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="KATR4T" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    1be8ae6f57d411ddbfe9001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    désignation attribut 4
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="KATR5" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    1be8ae7057d411ddb2b7001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    catégorie
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="KATR5T" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    1be8ae7157d411dda25c001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    désignation catégorie
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="KATR6" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    1be8ae7257d411ddab8b001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    sous-segment
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="KATR6T" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    1be8ae7357d411dda876001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    désignation sous-segment
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="Date" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    1be8ae7457d411dd8e6d001b387a26b0
    </xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="Promo_Nat" type="xsd:string">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    17ecb6e057fb11dd8725001b387a26b0
    </xsd:appinfo>
    <xsd:documentation xml:lang="EN">
    type de promo nationale
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="action" type="xsd:string" use="required">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    1be8ae6057d411dda41f001b387a26b0
    </xsd:appinfo>
    </xsd:annotation>
    </xsd:attribute>
    </xsd:complexType>
    <xsd:complexType name="DT_VT433_CLIENT_SAP_ET">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    8c8b5442649c11dda43d0050568b4d2e
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:sequence>
    <xsd:element name="Statement1">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    74a974a057e611dd8490001b387a26b0
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="TBL_IN_TCLIENT" type="TBL_IN_TCLIENT">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    74a974a157e611ddc27c001b387a26b0
    </xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="Statement2" minOccurs="0" maxOccurs="unbounded">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    74a974a257e611dd9747001b387a26b0
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="TBL_IN_ADV" type="TBL_IN_ADV">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    74a974a357e611ddadb8001b387a26b0
    </xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>

  • What is the key column name and value column name in JDBC Adapter parameter

    Hi
    Can any one please tell me what is the Key Column Name and Key Column Value in JDBC adatper parameters. If i dont mention those parameters i am getting the following error
    <b> Value missing for mandatory configuration attribute tableEOColumnNameId</b>
    Please help me
    Best Regards
    Ravi Shankar B

    Hi
    I am doing DataBase Lookup in XI
    First i have created a  Table in Database( CheckUser) which has two fields UserName and PhoneNumber and then i have created
    I have created one Communication Channel For Reciever Adapter .
    I have given the parameters like this
    JDBC Driver : com.microsoft.jdbc.sqlserver.SQLServerDriver
    Connection : jdbc:microsoft:sqlserver://10.7.1.43:1433;DatabaseName=Ravi;
    UserName.... sa
    password.... sa
    persistence : Database
    Database Table Name : CheckUser
    Key column name and Value column name i left blank and activated
    and then
    I have created
    Data Types : Source ...... UserName
                      Destination.... PhoneNumber
    Message Types
    Message Interfaces
    In Message Mapping
                  I have created one User Defined function DBProcessing_SpecialAPI().This method will get the data from the database....
    In this function i have written the following code
       //write your code here
    String query = " ";
    Channel channel = null;
    DataBaseAccessor accessor = null;
    DataBaseResult resultSet = null;
    query = "select Password from CheckUser where UserName = ' " +UserName[0]+ " '  ";
    try {
         channel = LookupService.getChannel("Ravi","CC_JDBC");
         accessor = LookupService.getDataBaseAccessor(channel);
         resultSet = accessor.execute(query);
         for(Iterator rows = resultSet.getRows();rows.hasNext();){
              Map  rowMap = (Map)rows.next();
              result.addValue((String)rowMap.get("Password"));
    catch(Exception e){
         result.addValue(e.getMessage());
    finally{
         try{
              if(accessor != null)
                   accessor.close();
         }catch(Exception e){
              result.addValue(e.getMessage());
    And the i have mapped like this
    UserName -
    > DBProcessing_SpecialAPI----
    >PhoneNumber
    when i am testing this mapping i am getting the following error
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Dest_JDBC_MT xmlns:ns0="http://filetofilescenario.com/ilg"><phoneNumber>Plain exception:Problem when calling an adapter by using communication channel CC_JDBC (Party: , Service: Ravi, Object ID: c360bc139a403293afbc49d5c46e4478) Check whether the communication channel exists in the Integration Directory; also check the cache notifications for the instance Integration Server (central Adapter-Engine) Channel object with Id Channel:c360bc139a403293afbc49d5c46e4478 not available in CPA Cache.
    com.sap.aii.mapping.lookup.LookupException: Problem when calling an adapter by using communication channel CC_JDBC (Party: , Service: Ravi, Object ID: c360bc139a403293afbc49d5c46e4478) Check whether the communication channel exists in the Integration Directory; also check the cache notifications for the instance Integration Server (central Adapter-Engine) Channel object with Id Channel:c360bc139a403293afbc49d5c46e4478 not available in CPA Cache.
         at com.sap.aii.ibrun.server.lookup.AdapterProxyLocal.<init>(AdapterProxyLocal.java:61)
         at com.sap.aii.ibrun.server.lookup.SystemAccessorInternal.getProxy(SystemAccessorInternal.java:98)
         at com.sap.aii.ibrun.server.lookup.SystemAccessorInternal.<init>(SystemAccessorInternal.java:38)
         at com.sap.aii.ibrun.server.lookup.SystemAccessorHmiServer.getConnection(SystemAccessorHmiServer.java:270)
         at com.sap.aii.ibrun.server.lookup.SystemAccessorHmiServer.process(SystemAccessorHmiServer.java:70)
         at com.sap.aii.utilxi.hmis.server.HmisServiceImpl.invokeMethod(HmisServiceImpl.java:169)
         at com.sap.aii.utilxi.hmis.server.HmisServer.process(HmisServer.java:178)
         at com.sap.aii.utilxi.hmis.web.HmisServletImpl.processRequestByHmiServer(HmisServletImpl.java:296)
         at com.sap.aii.utilxi.hmis.web.HmisServletImpl.processRequestByHmiServer(HmisServletImpl.java:211)
         at com.sap.aii.utilxi.hmis.web.workers.HmisInternalClient.doWork(HmisInternalClient.java:70)
         at com.sap.aii.utilxi.hmis.web.HmisServletImpl.doWork(HmisServletImpl.java:496)
         at com.sap.aii.utilxi.hmis.web.HmisServletImpl.doPost(HmisServletImpl.java:634)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    </phoneNumber></ns0:Dest_JDBC_MT>
    In RWB i have checked the status of JDBC driver its showing the following error
    <b>Value missing for mandatory configuration attribute tableEOColumnNameId</b>
    Best Regards
    Ravi Shankar B
    Message was edited by:
            RaviShankar B

  • Specify Keys in Data Type for receiver JDBC adapter

    Hi guys,
    I have the following issue:
    In a proxy to JDBC scenario, I want to specify somehow the key values for the SQL statement in the data type that I define for the receiver JDBC adapter. Thus, I am using the following structure in data type:
    root
        Statement
               dbTable
               action
               table
               access
                      CustomerID
                      Name
                      HouseNo
               Key
                      CustomerID
    But in the SQL statement that is produced (I can see that in RWB, CC Monitoring, Audit Log), the "Key" segment is translated into "OR". E.g. UPDATE_INSERT ("A100" "Evaggelos Gkatzios" "El Alamein 19") OR ("A100")
    Do you have any ideas ?

    Hi,
    Its clear from the statement in RWB (in CC monitoring's auditlog) you are using UPDATE_INSERT as the action.
    Please correct me if this is OK. Now the interpretation of input xml file will be like this,
    If the input XML is in the following format
    <root>
    <Statement>
    <dbTable action=UPDATE_INSERT>
    <table>EXAMPLE</table>
    <access>
      <CustomerID>ABC</CustomerID>
      <Name>xyz</Name>
      <HouseNo>123</HouseNo>
    </access>
    <key>
      <CustomerID>DEF</CustomerID>
    </key>
    </dbTable>
    </Statement>
    </root>
    Resultant SQL after parsing the XML file will be,
    1. It will first check with the condition WHERE CustomerID = DEF. If it finds the record with this condition then it will update the record with CustomerID=ABC, Name =xyz & HouseNo=123.
    2. If it doesn't find any record with that CustomerID then, it will insert a new record with the same details.
    In auditlog, you will find two SQL statements like,
    1.UPDATE EXAMPLE SET CustomerID=ABC, Name =xyz & HouseNo=123 WHERE CustomerId=DEF
    2.INSERT INTO EXAMPLE VALUES(ABC,xyz,123)
    hope this has given clear information about your query,
    Regards,
    Soorya

  • Violation of PRIMARY KEY constraint in JDBC receiver

    Hi Experts !
    I am configuring a JDBC Receiver. I need to insert the records and if the same record is coming again i need to update the records in my database.So I have used action "UPDATE_INSERT". But now I am getting the error,
    "Violation of PRIMARY KEY constraint-Cannot insert duplicate key in object " .. Pls help me out !!!  It is very urgent!!
    Thanks,
    Laawanya

    Lawanya,
    It seems that you are trying to update the primary key itself..
    One thing is sure The error is related to data....
    Do this at JDBC receiver Communication channel :
    Under advanced option : use parameter "logSQLParameter" and use value "TRUE"...by this way you will be able to see the values passing through JDBC receiver .
    And then check whether the same value exist in Table or not...
    Feel free to ping for further clarification..
    Regards,

  • Support for Generated Keys in oracke jdbc drivers?

    Hi All,
    Anyone know when the Oracle Thin JDBC drivers are going to support generated keys?
    Regards,
    Lee

    Sure Justin,
    I should have made myself more clear. Sorry about that.
    I have a sequence for generating primary keys in a particular table, and a trigger to replace a null in my insert query with the nextval. That all works fine. I would like to use the DB-neutral means of getting a generated primary key...
    prepStmt = connection.prepareStatement(insertSQL, Statement.RETURN_GENERATED_KEYS);
    prepStmt.executeUpdate();
    ... and later ...
    ResultSet generatedKeyRS = prepStmt.getGeneratedKeys();
    ... etc.
    I am aware that I can get this information several other Oracle9i-specific ways, including using the sequence's .currval and creating a callable statement that returns the primary key column. However I would still like to use the nice, neat, vendor-neutral JDBCv3 way. Call me pedantic.
    Regards,
    Lee

  • How do u automatically generate a primary key using JDBC?

    ok, basically i'm given a simple schema
    with 5 fields, one of these are made as a constraint made for primary keys.
    I am programming under Oracle, using JDBC, and everytime i insert a new record into the table using an INSERT statement it says it cant make the id null, well yeah, then how exactly do i make it generate a new ID?
    Thanks guys.

    In the table schema, the cid field is a INTEGER
    type.
    Ok i must of accidentally typed an extra digit, it's
    working now hmmm but i'm starting from this digit now
    : 1000000016
    If i go more higher and it truncates again, is there
    anyway to fix that?No. You can however write your code to verify it.
    Noting of course that the problem will next occur after 1 billion records have been added. So I would question at what rate you think that that table is going to grow.
    Of course you could create your own id but that would require modifying the table.

  • Updating primary key with jdbc

    Trying to update a primary key with:
    public static void updateTAXID(String coid,String accountnumber,String oldTAXID,String fundname,String newTAXID){ Properties props = TradeHelper.loadProperties(); Connection conn = null; PreparedStatement st = null; String sql ="update FinancialAccount set taxid=? " + "where dealernumber=? and " + "taxid=? and " + "fundname=? and " + "accountnumber=?"; try{ Class.forName(props.getProperty("driver")); conn = DriverManager.getConnection(props.getProperty("brokerageurl"), props.getProperty("user"),props.getProperty("password")); st = conn.prepareStatement(sql); st.setString(1, newTAXID); st.setString(2, coid); st.setString(3, oldTAXID); st.setString(4, fundname); st.setString(5, accountnumber); st.executeUpdate(); System.out.println("Update: new tx:"+newTAXID+":"+"Ol tx: "+oldTAXID+" act:"+accountnumber); conn.close(); st.close(); }catch(Exception e){ e.printStackTrace(); } }
    I keep getting this error:
    com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry '02673025561-QA-SLFCA-' for key 'PRIMARY'         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1011)         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491)         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)         at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)         at com.mysql.jdbc.PreparedStatement.exe
    Am I not able to update a single field of a composit key with jdbc? Whay is my update failing telling that there is a duplicate when I am trying to update?

    iketurner wrote:
    I keep getting this error:
    com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry '02673025561-QA-SLFCA-' for key 'PRIMARY'
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1011)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
    at com.mysql.jdbc.PreparedStatement.exeAm I not able to update a single field of a composit key with jdbc? Whay is my update failing telling that there is a duplicate when I am trying to update?If you take the error message at its word then the problem is not that you are not permitted to update a primary key but that the values you are trying to use is already in use.
    I'll leave it you DBA and/or Data Modeler/Architech to decide if it is a good idea to update the value or not.

  • Does JDBC insert a value into the Primary Key?

    Hi,
    I'm using a servlet to input data froma n html form ,into an ACCESS Database.I'm using SQL statements i t he servlet ,and i'm confronted with the question:
    ALL database records are indexed with B_ID as the "Primary Key".
    I want to know: If I add the fields without a B_ID ..will SQL/JDBC/Access automatically add one for me?
    Or must I create the system that will count the records before adding a new B_ID?
    Hope you can help me.Thanks!
    Aesh83

    Access has a datatype claus for this autoincrement feature.
    I just can't remember its name.
    If you have such a primary key column in your table, you would simply insert values in each column except that, so this would automatically generate its value by incrementing the key.
    Your INSERT had to enumerate all columns you explicitely fill with values and skip this key column and those ones which shall be set to NULL btw. the defined default value (is there a DEFAULT clause in Access?)

Maybe you are looking for