JDBC insert problem

Hi,
We are facing a peculiar issue in our zero date conversion. I do a date transformation of u201C00000000u201D to a constant date using the date trans function. During run time when the zero date is encountered it maps the correct constant date. But when we check the sql server DB, the date is created with an extra day. Eg: If we had set the constant date to 12/30/2005, the date in the sql server is 12/31/2005. But the XI mapping contains only 12/30/2005. Any ideas.
Teresa

HI
Why are you using a Date Transformation function, do one thng try using fixed value map and map if input is 00000000 to the date u want it to be.
Try this out.Also check if the Payload after mapping is has the right format and date which u want
In the JDBC reciver channel monitoring u can find it...
Rgds
Aditya

Similar Messages

  • JDBC Insertion Response

    Hello everybody,
    I have the next scenario:
    R/3 IDOC -> XI -> Oracle JDBC Insertion
    the problem is that the database is returning the reponse of the insertion and the idocs are asynchronous, so XI gives an error of mapping cause I can't map a synchronous interface to a asynchrounous one, can anyone help me with this problem any suggestions?????
    Thanks in advance,
    Regards,
    Julio Cesar

    Hi,
    If you want pass the data from IDOC to Oracle database to update the information of Oracle table,it is possible.
    see this for sample weblog....
    /people/prateek.shah/blog/2005/06/08/introduction-to-idoc-xi-file-scenario-and-complete-walk-through-for-starters
    For target JDBC structure see the following weblog...
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
    and also refer
    Re: IDOC to File Scenario
    Thanks
    Vikranth

  • Update/Insert Problem with Oracle Warehouse Builder

    Hello,
    i have update/insert problem with owb.
    Situation: I have a source-table called s_account and a target table called w_account_d. In the target table are already data which was filled trough the source table inserts. Now anyone make changes on data on the target table. This changes should now give further on the source table with an update operation. But exactly here is the problem i can´t map back the data to source because that will create a loop.
    My idea was to set a trigger but i can´t find this component in owb or is anywhere hidden?
    Also i have already seen properties as CDC or conditonal loading in the property inspector of the table, but i have no idea how it works.
    Give it other possibilities to modeling this case? or can anyone me explain how i can implement this eventually with CDC?
    I look forward for your replies :)

    Hi
    thanks for your answer. I follow your suggestion and have set the constraints of both tables into the database directly.Nevertheless it doesn´t work to begin. In the next step i found by right click on a table the listpoint "configure" - I goes to "unique key" --> creation method and set here follow options: Constraint State = ENABLE, Constraint Validation = Validate. That error message that appears before by the deployment disappears yet. Now i start the job to test if the insert/update process works right. Finally it seems to work - but not really.
    My Testscenario
    1. Load the data from source table about the staging area to data warehouse table: Check - it works!
    2. Change one data record in source table
    3. Load the source table with changed data record once again to staging area: Check - it works!
    4. Load new staging area table with the changed data record to data warehouse table: Check it works! BUT, BUT i can not recognize if it is insert or update operation, then under the design window by jobs execution windows is reported "rows selected 98", Rows inserted" is empty and "rows updated" is empty. So i think works not correct, then my opinion if it works correct it should show be "rows updated" 1.
    What can yet now still be wrong or forgotten? Any ideas?
    *By the way think not 98 rows there is not important if you make an update or insert which performance. It is an example table the right tables have million of records.*
    I look forward for your answers :)

  • RFC to JDBC(Insert) async scenario

    Hi Experts,
    In RFC to JDBC(Insert) async scenario  we are getting the the response from JDBC as <insert_count>1</insert_count> after inserting in to DB . Is there any way to stop getting response?
    Regards,
    Raj

    <insert_count>1</insert_count>
    Firstly this is not an error but an acknowledgement from the JDBC that the Insert for the corresponding Statement node is successful. The count 1 represents that you have made just one Insert-Statement call to the JDBC......had there been no Insert in the DB then you could have got 0 insetad of 1.
    Normally happens when the sender requests for an acknowledgement. Don have knowledge on the ABAP-front so cant comment on the blog given by Prateek, but seems that because of the sync nature of RFC you are getting this ack from JDBC...
    Regards,
    Abhishek.

  • CRUD insert problems.

    Hello all,
    I was wondering about DB operations in JSF pages, so I took a look over the Single Page CRUD example. What hitted me was there is a need for a two step insertion, first by issuing a select in search for the biggest ID of the primary key, and after that the insertion of the element with that obtained biggest ID + 1. I see at least 2 problems with this approach:
    1. Concurrency issues.What happends if 2 users are issuing at the same time an insert operation over the same table? There is the possiblity of getting the same ID to insert, and the first one could insert, but the second one would fail even if it's request is logically corect (validated & converted). I see three solutions over the insert problem:
    a. lock on the database (if it's possible).
    b. using a synchronized block in the application bean to get the ID and insert.
    c. using DB specific constructs (e.g. MySQL's AUTO_INCREMENT)
    2. Overhead issues. Why doing in two steps an operation that should be just an insert? Previous a. an b. approaches do not solve our overhead problem, because we still have two steps in insertion; we only synchronize them.
    I was wondering which is the best practice for production quality web applications. Personally because I've picked MySQL as DB I've used AUTO_INCREMENT, but the immediate huge and obvious drawback is dumping DataProvider's capability of changing the storage medium at a glance.

    I'm not sure if I entirely understood your questions here.
    - Concurrency problem.
    database bound Data provider underneath uses CachedRowset, which uses SyncProvider to take care of concurrency problem. If the default RIOptimisticProvider is not enough, it possible to register other more sophisticated SyncProvider.
    You can read about it here.
    http://java.sun.com/j2se/1.5.0/docs/api/javax/sql/rowset/CachedRowSet.html
    - Overhead issue
    I believe, it is possible to let the DB auto increment the primary key field, and left it out in the insertion from data provider.
    - Winston
    http://blogs.sun.com/roller/page/winston?catname=Creator

  • MSSQLServer jdbc connect problem on ODI 11G R2

    I have a MS SQL Server jdbc connect problem on ODI 11G R2 / Windows server 2008 64 bits.
    Tried, one by one, all versions of Microsoft drivers.
    Sqljdbc4.jar copied to : %appdata%\odi\oracledi\userlib\
    The Topology connect syntax is :
    driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
    URL : jdbc:sqlserver://<host>:1433
    => All the topology tests end with time-outs.
    Installed 10G ODI.
    Works with 1.4 java and sqljdbc.jar version 2 jdbc driver.
    Times out with version 3 and/or Sqljdbc4.jar + JAVA_HOME & ODI_JAVA_HOME set to 1.6 path.
    also tried, with no success (time-outs) on either 10g or 11g :
    com.inet.tds.TdsDriver
    jdbc:inetdae7://<host>:1433?database=<DB>
    same results for :
    net.sourceforge.jtds.jdbc.Driver
    jdbc:jtds:sqlserver://<host>:1433
    Any suggestions for a fix?
    Many thanks in advance.

    Hello,
    ODI (11g) Studio is certified on Windows 32 bit only, not on 64bit.
    However you may still install it and configure ODI Studio to run with a 32 bit java.
    Details pls see Master Note For ODI 11g Install Issues And Questions (Doc ID 1214428.1).
    To connect to SQL Server:
    # Check and make sure the authentication mode of your Microsoft SQL Server Server is set to "SQL Server and Windows" or "Mixed", otherwise Oracle Data Integrator (ODI) is unable to connect to the database.
    # Before you create the Oracle Data Integrator (ODI) Dataserver in Topology Manager > Physical Architecture, stop all ODI processes, and place the JDBC Driver file in the ODI's userlib and "/drivers" folder.
    For ODI Studio (Local No Agent)
    %APPDATA%\odi\oracledi\userlib
    %APPDATA% is the Windows Application Data directory for the user (usually C:\Documents and Settings\<user>\Application Data).
    Standalone Agent
    ODI_HOME\oracledi\agent\drivers
    Note: If you decide to use the DataDirect driver that comes with ODI 11g install/ embedded in ODI 11g
    weblogic.jdbc.sqlserver.SQLServerDriver
    Then you don't need to worry about this step.
    # Make sure that the database is the default database of the user account employed by ODI for connection, and that the password is correct.
    # Verify (in your Microsoft SQL Server Server network configuration) that TCP/IP has been enabled on port 1433.
    For more details see How To Set Up JDBC Driver Connections For The Microsoft SQL Server For ODI (Doc ID 423914.1)
    If you try sqljdbc.jar, you need to configure ODI_JAVA_HOME to jdk1.5
    sqljdbc4.jar, jdk1.6 (since ODI 11g requires jdk1.6, I'd suggest sqljdbc4.jar)
    More see Compatibility Matrix For Java Machines And JDBC Drivers Used With ODI (Doc ID 807235.1)
    Hope that helps other people who run into this,
    Edited by: user742480 on Apr 4, 2011 12:06 PM

  • Insert Problem jdbc odbc

    I have problem with my Insertion code. here is my code:-
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.sql.*;
    import java.lang.Class;
    import java.util.*;
    public class BookForm extends JFrame implements ActionListener
         //attributes
         private JTextField name, address, ICno;
         private JButton cancel, book;
         private JLabel lb1,lb2, lb3, lb4;
         private Container c;
         private Connection con;
         private ResultSet rs;
         private Statement stmt;
         private String looks;
         private String Busno, $seatno, $date, pric;
         public BookForm(String $Busno, String seatno, String date, String $price)
              super("Seat No. "+seatno);
              c = getContentPane();
              c.setLayout(null);
              c.setSize(260,260);
              Busno = $Busno;
              $seatno = seatno;
              $date = date;
              pric = $price;
              // ********** SET UP GUI **********
              try{
              looks = UIManager.getSystemLookAndFeelClassName();
              UIManager.setLookAndFeel(looks);
              SwingUtilities.updateComponentTreeUI(this);
              }//end of try
              catch(Exception e)
                   System.out.println("Error in UIManager");
              lb1 = new JLabel("Name");
              lb1.setSize(60,20);
              lb1.setLocation(30,30);
              lb2 = new JLabel("Address");
              lb2.setSize(60,20);
              lb2.setLocation(30,60);
              lb3 = new JLabel("IC No.");
              lb3.setSize(60,20);
              lb3.setLocation(30,90);
              lb4 = new JLabel("Seat No. : "+$seatno);
              lb4.setSize(100,20);
              lb4.setLocation(30,120);
              name = new JTextField();
              name.setSize(150,20);
              name.setLocation(100,30);
              address = new JTextField();
              address.setSize(150,20);
              address.setLocation(100,60);
              ICno = new JTextField();
              ICno.setSize(150,20);
              ICno.setLocation(100,90);
              cancel = new JButton("Cancel");
              cancel.setSize(70,30);
              cancel.setLocation(30,190);
              cancel.setMnemonic('L');
              book = new JButton("Print & Book");
              book.setSize(100,30);
              book.setLocation(140,190);
              book.setMnemonic('R');          
              c.add(lb1);
              c.add(lb2);
              c.add(lb3);
              c.add(lb4);
              c.add(name);
              c.add(address);
              c.add(ICno);
              c.add(cancel);
              c.add(book);
              cancel.addActionListener(this);
              book.addActionListener(this);
         }//end o BookForm()
         public void actionPerformed(ActionEvent e)
              Object source = e.getSource();
              if(source == book)
                   String nam = name.getText();
                   String add = address.getText();
                   String ic = ICno.getText();
                   String busn = Busno;
                   String seatn = $seatno;
                   String dat = $date;
                   boolean validation = validationFunction();
    if(validation == false)
    JOptionPane.showMessageDialog(null,"Please Fill the Form Completely");
    else{
         try{
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                        con = DriverManager.getConnection("jdbc:odbc:Bus","","");
                        stmt=con.createStatement();
                        stmt.executeUpdate("Insert Into PassengerBooking (Name,Address,ICno,BusNo,SeatNo,Date) VALUES ('"+nam+"' , '"+add+"', '"+ic+"', '"+Busno+"', '"+$seatno+"', '"+$date+"')");
         stmt.close();
                        con.close();
         catch(SQLException exc)
                             exc.printStackTrace();
                        catch(Exception exc)
                             exc.printStackTrace();
              else if(source == cancel)
                   this.setVisible(false);
         public boolean validationFunction()
              boolean check = true;
              String nam = name.getText();
              String add = address.getText();
              String ic = ICno.getText();
              if(name.equals(""))
                   check = false;
              else if(add.equals(""))
                   check = false;
              else if(ic.equals(""))
                   check = false;
              return check;
    I get syntax error in my Insert query. my database column name is: Name, Address, ICno, BusNo, SeatNo, Date
    and I have an auto number (BookNo) for that table as a primary key.
    Since I am a student and new in java, I dont know which code I type wrongly..
    Please Help me, This my Assignment which to be submited next week.
    Message was edited by:
    Triagip

    Note that there is a return value involved. I suggest you try the following first.
    executeUpdate
    public int executeUpdate(String sql)
                      throws SQLException
    Executes the given SQL statement, which may be an INSERT, UPDATE, or
    DELETE statement or an SQL statement that returns nothing, such as an
    SQL DDL statement.
    Parameters:
    sql - an SQL INSERT, UPDATE or DELETE statement or an SQL statement
    that returns nothing
    Returns:
    either the row count for INSERT, UPDATE or DELETE statements, or 0 for
    SQL statements that return nothing
    Throws:
    SQLException - if a database access error occurs or the given SQL
    statement produces a ResultSet object
    try {
      int returnValue = 0;  // Added
      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
      System.out.println("Step 1 complete");
      con = DriverManager.getConnection("jdbc:odbc:Bus","","");
      System.out.println("Step 2 complete");
      stmt=con.createStatement();
      System.out.println("Step 3 complete");
      returnValue = stmt.executeUpdate("Insert Into PassengerBooking "
                                      +"(Name,Address,ICno,BusNo,SeatNo,Date) "
                                      +"VALUES ('"+nam+"' , '"+add+"', '"+ic+"', '"+Busno+"', '"+$seatno+"', '"+$date+"')");
      System.out.println("Inserted ["+returnValue"+"] rows");
      stmt.close();
      con.close();
    }I absolutely agree with the advise you received in isolating the SQL pblms, by making sure the insert statement works apart from the Java wrapper code.

  • JDBC adapter , problem in inserting Korean Charaters in MS SQL

    Hi ,
    We are facing a problem when we are inserting "Koren Charaters" in DB of type MS SQL using JDBC adapter.
    What we tryed is:
    We found that there is a problem in Code Page Conversion.  We tried adding a Modules in Receiver Adapter of type JDBC.
    Processing Sequence:
    AF_Modules/XMLAnonymizer--Bean Local Enterprise Bean 1
    AF_Modules/TextCodepageConversionBean-Bean Local Enterprise Bean-- 2
    CallSapAdapter----
    Local Enterprise Bean     -- 0
    Module Configuration:
    1 anonymizer.encoding UTF-16
    2 Conversion.charset  UTF-16.
    But we are getting the error in CC as:
    "Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: ERROR occured parsing request:com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) feff, 3c, feff(:main:, row:2, col:6)(:main:, row=2, col=6) -> com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) feff, 3c, feff(:main:, row:2, col:6)"
    also should I have to check any patches related to JDBC driver from MS SQL which supports korean Code Page?
    Any one who had face this problem pls give us inputs:
    Thanks
    Shankar

    Hi
    In the XML sent to the channel you will have to use a special quoting
    for any Unicode strings, which the JDBC Adapter will not produce on its
    own. Instead, you need to add an attribute 'hasQuot="no"' to those
    elements (most likely in the mapping where you produce the XML) and
    explicitly enclose the data in single quotes prefixed with the letter N.
    For clarity, one example:
    If your original "INSERT" operation looks like this:
    <StatementName2>
    <dbTableName action="INSERT">
    <table>realDbTableName</table>
    <access>
    <col1>val1</col1>
    <col2>val2</col2>
    </access>
    </dbTableName>
    </StatementName2>
    and "col1" contains Unicode data, change the document as follows:
    <StatementName2>
    <dbTableName action="INSERT">
    <table>realDbTableName</table>
    <access>
    <col1 hasQuot="no">N'val1'</col1>
    <col2>val2</col2>
    </access>
    </dbTableName>
    </StatementName2>
    Regards
    Shankar

  • Problem executing a JDBC Insert on PI 7.1

    Hi,
    I'm trying to do a simple insert to a database in 7.1. but it keeps failing.
    The database table has been defined to allow nulls in every field.
    The mapping has been tested and maps correctly resulting in the following XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <root>
    <StatementName1>
         <dbTableName action="insert">
              <table>customer</table>
              <access>
                   <forename>Smith</forename>
                   <surname>John</surname>
                   <address1>1 streets ville</address1>
                   <address2>park avenue</address2>
                   <address_town>MyTown</address_town>
                   <address_county>Any County</address_county>
              </access>
         </dbTableName>
    </StatementName1>
    </root>
    The error is:
    com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'null' (structure 'Surname'): java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
    I have checked the logs on the database side and no statement has been logged.
    I have logSQLStatement as true on the communication channel. Again no statement logged.
    Any help much appreciated.
    Kind regards,
    John

    Hi John Lambert,
    I understand, when you logon to database, you are able successfully execute
    insert into customer (FORENAME,SURNAME) values ('john', 'smith');
    Now let's debug why XML structure is not working.
    Step 1:- In Interface Determination, do not refer to Operational Mapping (delete only OM from there, not the Receiver Message Interface). By doing so, you are not call the OM (which refer to Graphical Mapping (MM refer to Data Type (which may be wrong)). Note: As there is no OM, we need to send the exact payload (XML) required by receiver JDBC from Runtime Work Bench, for testing purpose.
    Step 2:- So now, you have to construct equalant XML structure to String "insert into customer (FORENAME,SURNAME) values ('john', 'smith');".
    SAP Help [Link1|http://help.sap.com/saphelp_nwpi711/helpdata/en/44/7b67fffde93673e10000000a114a6b/frameset.htm]
    <StatementName>
      <dbTableName action=u201DINSERTu201D>
        <table>customer</table>
          <access>
             <FORENAME>john</FORENAME>
             <SURNAME>smith</SURNAME>
           </access>
    </StatementName>
    Step 3:- Now use the XML you have constructed, to test the scenario from RWB. If it is successful.
    Step 4:- Now design your Message Mapping in such way that it will give output as above XML.
    Step 4:- Invert the changes done in Step 1. Include OM in Interface Determination.
    Regards,
    Raghu_Vamsee

  • JDBC insert statement problem

    i have the following code. please help me out.
    import java.io.*;
    import java.sql.Connection;
    import java.sql.DatabaseMetaData;
    import java.sql.ResultSet;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.sql.Statement ;
    import java.util.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class BookIssue extends JFrame
         JComboBox cbBooks;
         JLabel lblIssue;
         String selectedBook;
         JButton btnIssue;
         public BookIssue(String title)
              super(title);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
               lblIssue = new JLabel("Select books from combo box",JLabel.CENTER);
               btnIssue = new JButton("Issue");
              cbBooks = new JComboBox(new Object[] {"RaghuRamkrishnan","J2CR","Netwrok Security"});   
              Container cp=getContentPane();
              setLayout(new FlowLayout());
              cp.add(lblIssue);
              cp.add(cbBooks);
              cp.add(btnIssue);
              selectedBook =(String) (cbBooks.getSelectedItem());
              btnIssue.addActionListener(new IssueListerner());
              setSize(300,300);
              setVisible(true);
         }// constructor end
         class IssueListerner implements ActionListener
              Connection conn;
              Statement stmt;
                   public void actionPerformed(ActionEvent ae)
                         try
                              if(btnIssue==ae.getSource())
                                  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                                  conn = DriverManager.getConnection("jdbc:odbc:JemNat","","");
                                  stmt=conn.createStatement();
                                  stmt.executeUpdate("Insert into StudentIssueDetails(BookName) values(selectedBook)");
                             }///End outer if
                             stmt.close();
                             conn.close();
                         } //end try
                         catch(SQLException exc)
                             exc.printStackTrace();
                        catch(Exception exc)
                             exc.printStackTrace();
                    }   /// end function
          public static void main(String[] args)
              new BookIssue("Book Issue");
    } ///end class
         getting the following list of errors::
    ---------- java ----------
    RaghuRamkrishnan
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
         at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
         at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
         at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(JdbcOdbc.java:3111)
         at sun.jdbc.odbc.JdbcOdbcStatement.execute(JdbcOdbcStatement.java:338)
         at sun.jdbc.odbc.JdbcOdbcStatement.executeUpdate(JdbcOdbcStatement.java:288)
         at BookIssue$IssueListerner.actionPerformed(BookIssue.java:59)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
         at java.awt.Component.processMouseEvent(Component.java:5488)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

    stmt.executeUpdate("Insert into
    t into StudentIssueDetails(BookName)
    values(selectedBook)");What is this 'selectedBook'? Is this a variable name?
    In that case, you shouldn't be just writing it within the string. That would be an incorrect SQL. It should look like:
    stmt.executeUpdate("Insert into StudentUssueDetails(BookName) values('" +selectedBook +"')");Of course, a better way is to use PreparedStatement.

  • Oracle 8.1.5 JDBC driver problem with LONGVARCHAR

    Hi, I'm having problem with 8.1.5 release on Solaris with the
    JDBC type 4 driver (thin). If I create the following table
    create table test1 (col1 NUMBER, col2 LONG);
    Using JDBC driver to insert into the second column any string
    longer than 4000 characters causing run time exception. The type2
    driver works fine, but type2 is slow.
    String sql = "insert into test1 (col1, col2) values (1099,?)";
    PreparedStatement stmt ;
    stmt = conn.prepareStatement(sql);
    // create a string with very long value , bigger than 4096
    stmt.setString(1,string);
    stmt.executeUpdate();
    runtime exception:
    java.sql.SQLException: Data size bigger than max size for this
    type
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at java.sql.SQLException.<init>(Compiled Code)
    at oracle.jdbc.dbaccess.DBError.check_error(Compiled
    Code)
    at oracle.jdbc.ttc7.TTCItem.setArrayData(Compiled Code)
    at
    oracle.jdbc.driver.OraclePreparedStatement.setItem(Compiled Code)
    at
    oracle.jdbc.driver.OraclePreparedStatement.setString(Compiled
    Code)
    at testi.main(Compiled Code)
    Any help is appreciated.
    Thanks
    Steve
    null

    Post the full stacktrace here
    Also you might want to post jdbc related questions to weblogic.developer.
    interest.jdbc
    Kumar
    DreamNEON wrote:
    Hello,
    the NSAPI integration works, also the JSP files.
    But I have still problems with the Jdriver for my Oracle 8.1.5.
    I get the message :
    Failed to invoke startup class
    weblogic.jdbc.common.internal.JdbcStartup=weblogic.jdbc.common.internal.JdbcStartup
    when the WebLogic Server is started.
    Any ideas or hints about that?
    Thanks in advance
    Armin

  • JDBC insert with XMLTYPE data type

    Hi,
    SOAP to JDBC scenario. Oracle 11G as a receiver.
    Requirement is to  insert whole xml payload message in one of Oracle table fields as a xml string. Target oracle DB table column is defined with XMLTYPE data type, it has capacity to hold xml data more than 4GB. I am using graphical mapping with direct INSERT statement.
    When I try to insert xml payload with smaller size transaction goes through. However when the xml payload size increases it is giving following error in JDBC receiver communication channel monitoring.
    Could not execute statement for table/stored proc. "TABLE_NAME" (structure "StructName") due to java.sql.SQLException: ORA-01704: string literal too long
    Here is insert statement as in communication channel monitoring. (Note: XML payload with bold characters is truncated)
    INSERT INTO  TABLE_NAME (REQ_ID, OUTAGE_OBJ, TIMESTAMP, PROCESSED_FLAG) VALUES (VAL1, <?xml version="1.0" encoding="UTF-8"?>............</>, TO_DATE(2010-11-15 10:21:52,YYYY-MM-DD HH24:MI:SS), N)
    Any suggestions to handle this requirement?
    Thank you in advance.
    Anand More.

    Hi Anand,
    The problem here is definitely the length of the SQL query. i.e "INSERT INTO ......... VALUES......."
    This is what i got when i searched for this ORACLE error code:
    ORA-01704: string literal too long
    Cause: The string literal is longer than 4000 characters.
    Action: Use a string literal of at most 4000 characters. Longer values may only be entered using bind variables.
    Please ask a ORACLE DB expert on how to handle this Also i am not sure how can we handle Bind Varibales in SAP PI.
    I hope this helps.
    Regards, Gaurav.

  • PI JDBC INSERT Failed but message is registered as successful

    Dear all,
    We have a scenario where we send an IDOC with prices of several materials to PI and then using JDBC we send it to an SQL database. During the mapping, we create an INSERT statement for each segment of the IDOC .
    The problem is, that sometimes one or more insert statements may fail (the customer can see no new lines in the database), but in the monitoring everything seems ok . The message has a "processed successfully"  status so there is no way for the customer to know that something went wrong so each time they check the prices one by one .
    The strange part is that if they find a mistake, they just resend the same message and after one or two tries it works ! This indicates that the problem is not in the actual data but somewhere else (probably in the database ?) .
    So, one problem is why the data is not written and the second issue is why the message is logged as successful although one query has failed ,
    Thank you all for your help .

    Thank you for both for your quick response .
    Unfortunately this scenario is up and running for quite some time already and the customer does not want to change it . Also, I am not sure how I could make an Insert statement that would include many lines .
    Right now, the mapping produces the following result (I only post the first two statements, the actual number is around 500)
    <Statement><dbTableName action="INSERT">
    <table>min_sapsrs_price</table>
    <access><STAT>0</STAT><
    ACT_DATE>20100701</ACT_DATE>
    <MOD_DEL>MOD</MOD_DEL>
    <INTCODE>000000000014009003</INTCODE>
    </access>
    </dbTableName>
    </Statement>
    <Statement>
    <dbTableName action="INSERT">
    <table>min_sapsrs_price</table>
    <access><STAT>0</STAT>
    <ACT_DATE>20100701</ACT_DATE>
    <MOD_DEL>MOD</MOD_DEL>
    <INTCODE>000000000014009004</INTCODE>
    </access>
    </dbTableName>
    </Statement>
    could you please tell me how should I propose them to do it ?

  • Mapping multi-segment IDOC to multiple JDBC INSERT statements

    Hi Everyone,
    This is probably going to be easy for the experienced PI developers out there but I'm just starting out in this technology. We are running PI 1.11 and the scenario is as follows. We have a bespoke IDOC message type ZSTOCK which can contain 1-many segments with the following field content:
    WERKS
    MATNR
    VBELN
    ACT_LABST
    AVL_LABST
    For each segment in the source IDOC, I want to generate an INSERT statement to insert a row in an SQL table via the JDBC adapter with the following columns:
    Plant
    Material
    SalesOrd
    ActStock
    AvlStock
    Basically, each field on the source IDOC segment maps directly onto the target column of the SQL table. The problem is, on a multi-segment IDOC only the first segment is generating a row in the SQL table. I've seen a number of threads on this forum that seem to tackle the same issue but the solution is either missing or unclear. I think the solution lies somwhere in the occurrences of the STATEMENT node in my target message type and perhaps specific definitions in the message mapping. Can anyone help solve this mystery?
    Thanks,
    Gary

    Hi Gary
    If you created a data type, try to change occurrence of STATEMENT node to 0..unbounded or 1..unbounded.
    In the message mapping, map the target STATEMENT node with the source 1-many segment.
    You can find [here|http://help.sap.com/saphelp_nw70/helpdata/en/4d/8c103e05df2e4b95cbcc68fed61705/content.htm] more informations about the JDBC structure
    Regards,
    Giuseppe

  • Insertion problem .... plzzzzzzzzzzz help

    I have a jsp page code below mentioned...
    This jsp page retrieved values from a html files, which is shown as bold.
    my problem is that i cannot insert the values in database.plzz help me...
    <html>
    <head>
    <title></title>
    </head>
    <body>
    <%@ page import =" java.sql.Date.*" %>
    <%@ page import =" java.text.SimpleDateFormat.*" %>
    <%@ page import =" java.util.Date.*" %>
    <%@ page import =" java.text.*" %>
    <%@ page import="javax.servlet.*" %>
    <%@ page import="javax.servlet.http.*" %>
    <%@ page language="java" import="java.sql.*" %>
    <%
         String     Security_No, Category_code,Face_Value, Purchase_Value,Interest_Paid,Interest_Received,Brokrage,Total_Value,Voucher_No,Voucher_Date,Voucher_Amt,D_Date1,D_Date2,Ledger_No,Maturity_Date,sql1 ;
         java.util.Date voudate_temp=null;
         java.util.Date duedate1_temp=null;
         java.util.Date duedate2_temp=null;
         java.util.Date matdate_temp=null;
         ResultSet results;
         PreparedStatement sql;
    try {
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection conn=DriverManager.getConnection("jdbc:odbc:pf","scott","ttlscott");
         System.out.println("got connection");
              try
                   SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
                   format.setLenient(false);
                   int     sec_no, catg_code,face_val,pur_val,int_paid,int_recd,brkr,tot_val,vou_amt;
                   String vou_no, lf_no;
                   java.sql.Date vou_date, due_date1, due_date2,mat_date;
                   boolean     doneheading = false;
                   Statement s=con.createStatement();
              Security_No = request.getParameter("secno");
              Category_code = request.getParameter("catcode");
              Face_Value = request.getParameter("facevalue");
              Purchase_Value = request.getParameter("purvalue");
              Interest_Paid = request.getParameter("intpaid");
              Interest_Received = request.getParameter("intrecvd");
              Brokrage = request.getParameter("brokrage");
              Total_Value = request.getParameter("tvalue");
              Voucher_No = request.getParameter("vouno");
              Voucher_Date = request.getParameter("voudate");
              Voucher_Amt = request.getParameter("vouamt");
              D_Date1 = request.getParameter("due1");
              D_Date2 = request.getParameter("due2");
              Ledger_No = request.getParameter("lfno");
              Maturity_Date = request.getParameter("maturity");          
              sql1 = "insert into sec_mast values (" + "'" + Security_No + "', '" Category_code "' , '" + Face_Value + "', '" + Purchase_Value + "', '" + Interest_Paid + "', '" + Interest_Received + "', '" + Brokrage + "', '" + Total_Value + "', '" + Voucher_No + "', #"+ Voucher_Date+ "# , '" + Voucher_Amt + "', #" + D_Date1 + "#, #" + D_Date2 + "#, '" + Ledger_No + "', #" + Maturity_Date + "#)" ;
              s.executeUpdate(sql1);               
                   sql = con.prepareStatement("SELECT * FROM sec_mast WHERE sec_no = '" + Security_No + "' ");
                   results = sql.executeQuery();
                   while(results.next())
                        if(! doneheading)
                             doneheading = true;
    sec_no = results.getInt("sec_no");
    catg_code= results.getInt("catg_code");
    face_val = results.getInt("face_val");
    pur_val = results.getInt("pur_val");
    int_paid= results.getInt("int_paid");
    int_recd = results.getInt("int_recd");
                        brkr = results.getInt("brkr");
    tot_val= results.getInt("tot_val");
                        vou_no = results.getString("vou_no");
                        voudate_temp = results.getDate("vou_date");
    vou_amt = results.getInt("vou_amt");
                        duedate1_temp = results.getDate("due_date1");
    duedate2_temp= results.getDate("due_date2");
    lf_no= results.getString("lf_no");
         matdate_temp = results.getDate("mat_date");
    java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("MM/dd/yyyy");
                   sdf.setTimeZone(TimeZone.getDefault());
                   vou_date = sdf.format(voudate_temp);
                   java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("MM/dd/yyyy");
                   sdf.setTimeZone(TimeZone.getDefault());
                   due_date1 = sdf.format(duedate1_temp);
                   java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("MM/dd/yyyy");
                   sdf.setTimeZone(TimeZone.getDefault());
                   due_date2 = sdf.format(duedate2_temp);
                   java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("MM/dd/yyyy");
                   sdf.setTimeZone(TimeZone.getDefault());
                   mat_date = sdf.format(matdate_temp);
    out.println("<BODY bgColor=blanchedalmond text=#008000 topMargin=0>");
    out.println("<P align=center><FONT face=Helvetica><FONT color=fuchsia > <BIG>SECURITY INFORMATION</BIG></FONT></P>");
    out.println("<P align=center>");
    out.println("<TABLE align=center border=1 cellPadding=1 cellSpacing=1 width=\"75%\">");
    out.println("<TR>");
                        out.println("<TD>Secuirty No.</TD>");
    out.println("<TD>Category Code</TD>");
    out.println("<TD>Face Value</TD>");
    out.println("<TD>Purchase Value</TD>");
                        out.println("<TD>Interest Paid</TD>");
                        out.println("<TD>Interest Recieved</TD>");
    out.println("<TD>Brokrage Value</TD>");
    out.println("<TD>Total Value</TD>");
    out.println("<TD>Voucher No.</TD>");
    out.println("<TD>VOucher Date</TD>");
                        out.println("<TD>VOucher Amount</TD>");
    out.println("<TD>Due Date 1</TD>");
                        out.println("<TD>Due Date 2</TD>");
    out.println("<TD>L F No.</TD>");
                        out.println("<TD>Maturity Date</TD>");
                        out.println("<tr><td>" + sec_no);
                        out.println("<td>" + catg_code);
                        out.println("<td>" + face_val);
                        out.println("<tr><td>" + pur_val);
                        out.println("<td>" + int_paid);
                        out.println("<td>" + int_recd);
                        out.println("<tr><td>" + brkr);
                        out.println("<td>" + tot_val);
                        out.println("<td>" + vou_no);
                        out.println("<tr><td>" + vou_date);
                        out.println("<td>" + vou_amt);
                        out.println("<td>" + due_date1);
                        out.println("<tr><td>" + due_date2);
                        out.println("<td>" + lf_no);
                        out.println("<td>" + mat_date);
                   if(doneheading)
                        out.println("</table>");
                   else
                        out.println("<BODY bgColor=blanchedalmond text=#FF0000 topMargin=0>");
                        out.println("<P align=center><FONT face=Helvetica><FONT color=fuchsia ></FONT></P>");
    out.println("<P align=center>");
                        out.println("No matches for " + Security_No);
                   }catch(ParseException e) {
    out.println("do date format error action.<br>");
              catch (SQLException s)
                   out.println("<BODY bgColor=blanchedalmond text=#FF0000 topMargin=50>");
                        out.println("<P align=center><FONT face=Helvetica><FONT color=fuchsia ></FONT></P>");
    out.println("<P align=center>");
                   out.println("Duplicate Entry.Try another Security Code No.<br>");
              catch(ParseException e) {
              out.println("do date format error action.<br>");
         catch (ClassNotFoundException err)
              out.println("Class loading error");
    %>
    </body>
    </html>

    you should try posting it in the jsp forum.what error/exceptions are you getting if any?

Maybe you are looking for

  • How to remove Windows Sign-in with Password upon Startup

    hi. Can anyone help me? Whenever we buy a new laptop, my husband always told me to "just leave it blank" , referring to the Microsoft Windows sign in with blank box for typing in a password. "This way you don't have to type your password everytime yo

  • Possible to decode base64 document contents to XDP?

    Hi, As the title says, is it possible to decode the base64-encoded contents of my PDF back to an XDP format? Using this JavaScript SOAP.stringFromStream(SOAP.streamEncode(Collab.documentToStream(event.target), "base64")); I am able to submit the base

  • Inventory cube maintenance

    Hi, We are using the inventory cube 0IC_C03 for the past 3 years and we have about 100 million records. We have a few reports running off the cube. Now because of the hugh amount of data the query execution takes a very long time approx 20mins. Are t

  • Warranty for ebay purchased items

    I purchased my Iphone 5 from ebay and now i face hardware problem screen rotation is not working i try to get support from local service center But they told the warranty is covered only in USA So what is the solution?

  • Mediasource 5 and audio conver

    hi, the new audio converter and mediasource?doesnt seem to be able to convert files into mp3 format. is something wrong? only wma and wav formats are available. thanks.