Problem while doing insert

Hello.
I'm trying to write the following String containing an XML document, in a MySql database:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ReporteHoras SYSTEM "ReporteHoras.dtd">
<ReporteHoras>
<Persona nombre="Daniel">
<Fecha dia="1/11/2004" horas_teoricas="8">
<Proyecto cod="001">
<Tarea nombre="x">
<Horas>8</Horas>
</Tarea>
<Tarea nombre="y">
<Horas>5</Horas>
</Tarea>
</Proyecto>
</Fecha>
<Fecha dia="2/11/2004" horas_teoricas="7">
<Proyecto cod="010">
<Tarea nombre="z">
<Horas>8</Horas>
</Tarea>
</Proyecto>
</Fecha>
</Persona>
</ReporteHoras>
And I get the following exception:
(ReportesReceiver.HorasGMSReceiver 219 ) error al ejecutar tareas SQL: java.sql.SQLException: Syntax error or access violation, message from server: "You have an error in your SQL syntax near 'VALUES ('91750418', 'horasgms', '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!D' at line 1"
4729468 [imqConsumerReader-0-8919380558701437696-0] ERROR starting.src.java.ReportesReceiver.HorasGMSReceiver - error al ejecutar tareas SQL: java.sql.SQLException: Syntax error or access violation, message from server: "You have an error in your SQL syntax near 'VALUES ('91750418', 'horasgms', '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!D' at line 1"
java.sql.SQLException: Syntax error or access violation, message from server: "You have an error in your SQL syntax near 'VALUES ('91750418', 'horasgms', '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!D' at line 1"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1697)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1083)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1142)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1876)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1590)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1653)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1492)
at starting.src.java.ReportesReceiver.HorasGMSReceiver$GMSListener.onMessage(HorasGMSReceiver.java:210)
at com.sun.messaging.jmq.jmsclient.MessageConsumerImpl.deliverAndAcknowledge(MessageConsumerImpl.java:247)
at com.sun.messaging.jmq.jmsclient.MessageConsumerImpl.onMessage(MessageConsumerImpl.java:210)
at com.sun.messaging.jmq.jmsclient.SessionReader.deliver(SessionReader.java:76)
at com.sun.messaging.jmq.jmsclient.ConsumerReader.run(ConsumerReader.java:153)
at java.lang.Thread.run(Thread.java:534)
It seems that the string contains some illegal characters, but I don't know where they are.
I do the following to insert the data:
java.sql.Connection conn = conexion.getDbConn();
PreparedStatement pstmt = conn.prepareStatement(insertSQLString);
pstmt.setString(1, processId.toString());
pstmt.setString(2, "horasgms");
pstmt.setString(3, contenido);
pstmt.executeUpdate();
Can anyone tell me what am I doing wrong?
Thank you in advance.
Regards.
Dani.

> > <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ReporteHoras SYSTEM
"ReporteHoras.dtd">This is where the illegal character comes ... I think
it has a problem with "!"
***Annie***Caller = aashu Site = unknown Caller Info. = singh Kind = level1 state = OPEN Errorjava.sql.SQLException: Syntax error or access violation, message from server: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' Project_Name, Client_Location, Client_Country, Client_Contract_HW INTO client_i' at line 1"
codes as following:-
<%@ page import="java.util.*,java.text.DateFormat, java.io.*,java.net.*,java.sql.*,java.sql.Connection,java.sql.DriverManager,java.sql.Statement"%>
Caller = <%=request.getParameter("caller")%>
     <% String s = request.getParameter("caller");%>
     Site = <%=request.getParameter("site")%>
     <% String s2 = request.getParameter("site");%>
Caller Info. = <%=request.getParameter("callerinfo")%>
     <% String s3 = request.getParameter("callerinfo");%>
     Kind = <%=request.getParameter("kind")%>
     <% String s4 = request.getParameter("kind");%>
state     = <%=request.getParameter("state")%>
     <% String s5 = request.getParameter("state");%>
<%
try     
{ Class.forName("com.mysql.jdbc.Driver").newInstance();
                    // String connectionURL ="jdbc:mysql://localhost:3306/client_db1?user=;password=";
               //Connection con = DriverManager.getConnection(connectionURL,"","");
     Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/client_db1?user=;password=","","");
     Statement st = con.createStatement();
st.executeUpdate("INSERT Client_Name, Project_Name, Client_Location, Client_Country, Client_Contract_HW INTO client_info values('"+s+"', '"+s2+"', '"+s3+"', '"+s4+"', '"+s5+"')"); %>
<%}
catch(Exception e)
{ out.println("Error"+e);
%>[b]

Similar Messages

  • Problem while doing bdc for fv60

    Hi frends,
       I got problem while doing BDC for fv60 tcode.i have given
    header items:
    vendor number
    invoice date
    posting date
    amount
    item data:
    g/l acc no: 100000
    amount 1000 whatever
    these are all given in recording
    in recording after all giving this data if we click on park it is telling "parking not possibe duiring batch input".
    can any body tell me the process for recording shdb and after that in bdc how can we give multiple line items for fv60
    thanks,
    naveen.

    I don't think you can use FV60 in batch input. Your options are to use transaction FBV1 or bapi BAPI_INCOMINGINVOICE_PARK.
    Rob

  • Want to save time while doing inserts or updates using JDBC

    I want to save time while doing inserts/updates in a database in my Java app. using JDBC. My app. has to do a lot of inserts and that takes up a lot of time.
    I can do some buffering and then do bulk/batch inserts if that will help. any pointers on whether this will be useful and how to go about it?
    Is there any other way I can save time and thereby improve performance?
    I am using Oracle 8 with Oracle thin driver.
    Thanks

    I tried using the PreparedStatement.addBatch() and PreparedStatement.executeBatch() in a test program.
    The error is SQLException - "Unsupported feature" which I get at the addBatch method call. I am using oracle thin driver sdk 8.1.6 for jdk 1.2.x
    What is wrong here?
    Thanks

  • Facing problem while doing MIRO

    Hi gurus,
    I facing problem while doing MIRO, system showing the message "Customization for "company code" J_1iindcus missing in the table"
    pls help

    Hi,
    Please do customization for India Localisation-Phase-II.
    In transaction J1IT, maintain company code settings.
    J1IT->Global Settings->Company Settings
    Reward if useful.

  • STO Problem while doing GR against outbound delivery

    Hi Gurus,
    Need your help regarding STO,in my case i created
    1. STO
    2. Delivery in VL10B t code and did PGI
    3. on the basis of Delivery i created billing document
    4. Excise invoice in J1IIn
    Now while doing GR against outbound delivery system in not doing GR giving some error code 1 as follows
    Goods receipt not possible for delivery 4900000212: error code 1
    Message no. M7865
    Diagnosis
    The goods receipt for the delivery cannot be posted.
    The error according to the error code:
    1. The delivery does not exist.
    2. The delivery type is unknown.
    3. The delivery is not goods issue posted.
    4. There are no delivery items.
    5. The receiving plant could not be determined.
    6. The delivery items have already been goods receipt posted or contain zero quantities.
    7. Goods receipt(effect)movement type to goods issue movement type could not be determined.
    8. It is not currently possible to block the delivery.
    Procedure
    Error code 1      : Check your entry.
    Error code 2,3,4,6: Check the delivery and its document flow.
    Error code 5      : The delivery must be related to a purchase order or
                        the customer must be a retail business.
    Error code 7      : Check the settins for your movement types.
    My delivery types shipping points everthing is in place but am not able to trace out whats the problem. Please help its urgent
    Regards
    Vivek

    Hi
    Based on the error code 1 , it says that the delivery does not exists in the system, That means you cannot perform a Goods receipt againsst the document specified
    I have also not done Goods receipt with reference to Outbound delivery. So i am not able to confirm that this can be done or not.... i will definitely get back to you on this.
    Thanks & Regards
    Kishore

  • Problem while doing PGI for Returns Delivery

    Hi,
    We are facing some problem which doing PGI for a returns delivery. Our scenario is HU and WM managed. After creation of delivery I have created a TO and has two different valuation type of same material. Total quantity in TO is 2, 1 of each valuation type. So, automatically, batch split happened for the line item in delivery.
    Now when I am trying to do PGI for this delivery, I get en error message saying "Enter Valuation Type". The movement type used here is 161 (Vendor Returns)
    Same thing is happening successfully for movement type 643 (Transfer inter company code).  What I can gather is that while creating 161 document against delivery system is not automatically taking the valuation types mentioned in line item of delivery.
    Let me know possible reasons for this error and resolution.
    Regards,
    Vishal

    Implement the OSS note 965985

  • Problem while doing vl10d ....

    Hi experts  ,
    I'm facing a peculiar problem . While doing VL10D / vl10g , the outbound delivery document no. is not generated - and it's showing like this ... I don't know why it behaves as such ?? ....
    During creation of purchase order it behaves properly , shows the shipping tab - properly filled the shipping data and others inputs .
    Please help me to get the problem is resolved ...
    regards
    arghya .

    Hi Arghya,
    Couple of thing which you need to check
    1. Can You post the screenshot of the STO number in VETVG table
    2. Check the delivery date on the STO.
    3.Also in the item level check the chipping table route is populated.
    4. Also check the STO has been released
    Arun Prasad

  • Problem while doing the Cheque print through f-58

    Dear Team,
    I am encountering an issue while doing the Transaction through F-58 System is generating the cheeque print with coma instead of decimals i.e instead of 1,00,000.00 its comming as 1.000.000,00.
    Please advice how to correct this.
    Thanks for the consideration.
    Regards,
    Suma Nalluri.

    Dear Nambi,
    I have checked the settings there evry thing is fine.Still i am facing the same issue. I do not understand may be due to any bug .Please advice.
    Regards,
    Suma.

  • Hi, problem while doing Release Strategy.

    Hi,
    I am having a problem while Creating Release Groups.
    " Please Check Release Classes (See Long Texts)"
    This is appearing on the Screen while I am trying to Save the Release Group.
    Please anyone give me solution for this.............
    Thanks & Regards,
    Swathi

    Hi,
    I think this happens because you are defining different release group using different class but using same class type for those classes.
    E.g.:
    ====
    Rel. Grp     Class
    98              Z_Class1
    99              Z_Class2
    Z_Class1 has the same class type as Z_Class2.
    Hopefully this helps.

  • Problem while doing PGI

    I tried searching for this error below but i could not find any relevant thread.
    I get the following error while doing PGI:
    Fld selectn for mvmt type 601 / acct 7001012003 differs for Sales order (013)

    but i could not find any relevant thread
    Surprising!!!!!!
    Not sure with what text you had searched.  Either the error message should be typed in full without any abbreviation or with error message number.  More than 15 threads you can find in Google.
    G. Lakshmipathi

  • Problem while doing MFBF

    Hi Gurus,
    While doing MFBF transaction i was not able to see the 131 movement in MB03 T.code.
    I was able to see the 261 movements fine as well.
    Help to solve this..
    Thanks.

    Hi,
    Please check the control key maintained in the routing of the material.
    Auto GR should be activated in the control key (PP03)
    Then you need not go for seperate GR for the material.
    Come back if any issues.
    Ghanshyam

  • Problems while doing following Tutorial

    Hello all,
    I have problems while completing following tutorial:
    http://www.oracle.com/technology/obe/obe9051jdev/ToplinktoDatabinding/toplinktodatabinding.htm
    Everything is fine until I reach the step to create the databinding.
    After I drag and dropped the table to the databinding field, I get following warning:
    Warning, no session.xml
    A session.xml, that can be created from New Gallery, was not detected fpr the TopLink project associated with the selected class. In order tu use the TopLink Client/Server erchitecture, you must define a session.xml containing a Server Session for the associated TopLink project. If uou continue without creating a session.xml, this data control will not have the benefit of a Server Session shared across the given application (recommended TopLink architecture for ...
    Is it necessary to have such a session.xml?
    And after I finished the tutorial, I don't get any data, in every case, wether with or without a session.xml.
    It would be nice, if anyone could give me a answer. Thanks a lot.

    Problem solved:
    created a session.xml and everything worked fine.

  • Problems while doing a rollback on MQSeries using a java client

    Hi,
    I'm new to using MQSeries with Java client. I have a kind of similar problem. I have a set of messages in a Queue. When i'm doing a rollback on certain message it's returing to the same pointer where it had come from in the queue. When i'm iterating through the messages in the queue using a for loop, the same message is again retireved. So, i tried to set the setMQGMO_MARK_SKIP_BACKOUT flag to true. But i'm getting an RequestException with error code 2046: MQRC_OPTIONS_ERROR
    Any help on this would be highlly appreciated.
    I'm pasting the code snippet below.
    Class X {
    public void receive(
    com.stc.connector.webspheremqadapter.message.IMessage input, com.stc.connector.webspheremqadapter.message.IMqOtd
    MQSeries_1){
    int msginqueue = MQSeries_1.getCurrentDepth();
    String corrID = "";
    byte[] corrIDInputArray = input.getMsgHeader().getCorrelationId();
    String corrInputID = (new String( corrIDInputArray )).trim();
    for (int i = 0; i < msginqueue; i = i + 1) {
    MQSeries_1.getQueue().getGMO().setMQGMO_SYNCPOINT( true );
    MQSeries_1.getQueue().getWithOptions();
    byte[] corrIDArray = MQSeries_1.getMessage().getMsgHeader().getCorrelationId();
    corrID = (new String( corrIDArray )).trim();
    if (corrID.equalsIgnoreCase( corrInputID )) {
    MQSeries_1.commit();
    } else {
    MQSeries_1.getQueue().getGMO().setMQGMO_MARK_SKIP_BACKOUT( true );
    MQSeries_1.backout();
    }

    I agree that you should check for a specific axis / tomcat forum (maybe on apache website??;)) anyway ... check the path and classpath you use while building the wsdd file and when running the adminclient, and check the syntax of its invokation

  • Facing a problem while doing DML Operations in Discoverer (Urgent!!)

    Hi,
    I am facing a problem in one of the discoverer report i am working on. I would appreciate if you could help me to to find a solution for this -
    I am triggering a custom package from the Discoverer. This package is inserting the data in a custom table. As we can not directly put the DML statements in the discoverer 's package so i have defined that package as the Pragma Autonomous. The custom table that is being populated is a regular table (i.e not a Global temporary table). In the custom folder in Administrator i am just selecting the data from that custom table.
    Problem- When i run the report from discoverer, the data is getting inserted into the custom table, that means the package is working properly but still the report does not show any data. May be the query being executed even before the data is inserted into the table. Can you please suggest what is that i am missing in this solution?
    Few facts of the report-
    1. I am using only one worksheet.
    2. The package is inserting the data in the custom table so i don't see any problem with the package and triggering it.
    Thanks for your help.
    -Anshul

    Hi Michael,
    This is not really an update. The functionality of the report is simple - Based on the parameters selected in the report, the package will get the data from queries and insert into the table. now the data in the table can be different for different users based on the parameters. what my concern was,
    Consider a case of 2 users using this report almost at the same time.
    We are not using the temporary table so we will have to truncate the table every time the report is ran, before inserting the new data in it.
    Now suppose user -A runs the report and during it processing the 2nd user runs it with some different parameters. Then the 1st user's data will be deleted from the table.
    does it sound right?
    I was trying to achieve this functionality by using following functionality but here also i am facing a problem -
    Now i am not inserting the data in the table but i have created a view that does the same thing as it was done by package in the previous case. and in order to pass the parameters in the view i am using set_context. I have created a package that is triggered by discoverer report and in that package i am setting the context. now i am facing the following problems -
    a. Does the Set_context set the context globally?
    b. Do i need to clear the context at the completion of report?
    c. If the answer of the question - b is yes then where can i place that clear_context in the discoverer?
    Thank you so much for your help.
    thanks
    -Anshul

  • Problem while doing GR with Posting periods

    I am New to SAP..
    When I am doing GR the system is throughing an error as under:
    "Posting only possible in periods 2007/03 and 2007/02 in company code XXXX"
    When I am try to close the period by MMPV it is not allowing me to do the same. And it is showing as under:
    "The company code XXXX can no longer be initialized"
    I did the following
    SPRO --> Logistics - General --> Material Master --> Basic Settings --> Maintain Company Codes for Materials Management
    where in for my company code XXXX
    Year is 2007
    period is 3
    when I try to change the period to 4 it is again showing the message as :
    "The company code XXXX can no longer be initialized"
    Wher can I initialize my company code?
    Can any body help me in this regard..
    Thanks in advance..
    Vam C

    Hi Biju
    I used OB52 and created variance and assigned to company code...but..
    My problem not solved...same error occuring..
    Can you suggest some solution..?
    Hi Dipak,
    I tried MMPV also..
    It is giving the following error:
    Follow the instructions in Note 487381 before initialization..
    Can you suggest some solution..?
    Thanks in advance,
    Vam C

Maybe you are looking for

  • How to get the files in presentation server while uploading?

    how to get the files in presentation server while uploading? give me the function module name

  • Keyboard Shortcut will not work

    I was following Kelby's Frame Tutorial: http://www.scottkelby.com/blog/2010/archives/12235 He talks about the Intersect shortcut - CTRL - ALT - Shift and then click the thumbnail of the layer. It doesn't work for me and I wondered if a better mind th

  • Software Version 1.2.2

    As I tried to sync my 30gig iPod video yesterday, it asked me if I would like to update my software version to 1.2.2. I clicked yes and it reset my iPod. Now, when I sync, it doesn everything as normal. iTunes shows no sign of a problem. After I dico

  • CSS load balancing issue

    Hi, I'm facing a problem with CSS while load balaning for the web application with two servers. The application is based on activex.. Basically I have two servers running web application for which I have created VIP in the CSS, user hits the VIP addr

  • CTS transport in Integration Directory

    Hello, We are running NW70 SP13 and have fully configured CTS+ as per the SAP documentation for SP13 specifically. In Integration Repository we can see the export option using CTS but in the Integration Directory for scenarios we do not see the "Tran