Jdbc insert query hangs

We have 2 instances of the same program running in parallel. The application inserts data to a database table. one of the instance just hangs when it is trying to insert a query to database i.e. when executing statement.executeUpdate(). We are using a prepared statement to bind all parameter values. Instance 1 keeps running but instance 2 hangs and goes in a waiting state.
Is there any suggestions on how can this issue be investigated. I know a possible reason for hanging could be database lock, but I cannot understand, how it can have a database lock for insert query.
oracle : 9.2.0.7
java : jre 1.4

user551224,
Are you running two separate Threads that both use the same database connection?
This issue has been discussed previously in this forum.
Search the forum archives for more details.
It could also be because of a database lock.
Are you trying to insert rows into the same table?
You could try using the FOR UPDATE NOWAIT clause to verify.
Good Luck,
Avi.

Similar Messages

  • JDBC batch query with insert sometimes hangs on executeBatch

    We have the following problem:
    Java client sends through JDBC INSERT query using batch,
    and sometimes this query hangs.
    In V$SESSION ACTIVE session appears, which remains ACTIVE forever.
    Also locked object appears in V$LOCKED_OBJECT and open coursor appears.
    How to know what happens inside the query? Why it hangs?
    This is a thread dump for jdbc thread:
    The thread dump is listed below:
    "SdrWriterThread-1" prio=5 tid=0x184264c8 nid=0x214 runnable [18f1f000..18f1fd94]
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at oracle.net.ns.Packet.receive(Unknown Source)
    at oracle.net.ns.NetInputStream.getNextPacket(Unknown Source)
    at oracle.net.ns.NetInputStream.read(Unknown Source)
    at oracle.net.ns.NetInputStream.read(Unknown Source)
    at oracle.net.ns.NetInputStream.read(Unknown Source)
    at oracle.jdbc.ttc7.MAREngine.unmarshalUB1(MAREngine.java:718)
    at oracle.jdbc.ttc7.MAREngine.unmarshalSB1(MAREngine.java:690)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:373)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:822)
    - locked <0x10641b80> (a oracle.jdbc.ttc7.TTC7Protocol)
    at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1446)
    at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1371)
    at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:2883)
    - locked <0x100900d0> (a oracle.jdbc.driver.OraclePreparedStatement)
    at com.jnetx.xr.persistence.DAO.executeBatch(DAO.java:66)

    Anton,
    Why it hangs?It's waiting for a lock to be released. The default behaviour of Oracle is to wait indefinitely for a lock to be released.
    You can see this behaviour if you try to update the same row from tw different "SQL*Plus" sessions, for example (since the default behaviour of "SQL*Plus" is not to automatically commit changes).
    In one "SQL*Plus" session, update a row -- but do not commit. In the second session, try to update the same row -- it "hangs". It will remain like this until the first session releases the lock. The simplest way to release the lock is for the first session to execute either a "commit" or "rollback". As soon as you do that, you will see the first session become unstuck.
    Of-course, from the [lack of] information you have posted, I cannot tell you what is holding the lock, or why.
    Good Luck,
    Avi.

  • JDBC Receiver: Check INSERT Query.

    Hi Experts,
    I am working on IDOC To JDBC(INSERT) Scenario.
    Is there any possibility to check the INSERT Query that triggered by Receiver Adapter? If its possible please guide me how .
    Thanks,
    Vijay.

    Hi Vijay,
    Configure parameter logSQLStatement = true in advanced parameter of JDBC receiver channel. It will show the INSER query in audit log of message which you can see from message monitoring of RWB.
    Regards
    Sushil

  • Checking the status of the insert query in JSP

    frendz,
    i am working with JSP .i have some content to be inserted in the database.i have used the insert query in SQL for that.i am able to check whether it has been inserted properly in the SQL but i want to check the status of the insert query with its return value(so that i can confirm it does not return a error).so please help.

    The Statement#executeUpdate() returns an int with the row count. Get hold of it.
    Also see the Statement API: http://java.sun.com/javase/6/docs/api/java/sql/Statement.html
    Apart from this, I recommend you to use PreparedStatement instead. It will not only ease setting Java objects in a query (no hassle anymore with quotes), but it will also prevent you from SQL injections.
    Prepare here: http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html
    SQL injections: http://en.wikipedia.org/wiki/SQL_injection

  • Maximum length of identifier in insert query

    Hi,
    I am using Sybase 12.0 with JConnect 5.
    I am facing some problem with insert query.
    It gives exception like " identitifer is too long maximum length is 30"
    If i run then same query on winSql its working fine but with JDBC not working.
    Pls help me reagrding this.

    Hi,
    this is the error message i am getting
    com.sybase.jdbc2.jdbc.SybSQLException: The identifier that starts with '"T3211PU,,insert into Illustr' is too long. Maximum length is 28.
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.sybase.jdbc2.tds.Tds.processEed(Tds.java:2408)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.sybase.jdbc2.tds.Tds.nextResult(Tds.java(Compiled Code))
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.sybase.jdbc2.jdbc.ResultGetter.nextResult(ResultGetter.java:69)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:201)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:182)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.sybase.jdbc2.jdbc.SybStatement.executeLoop(SybStatement.java:1535)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.sybase.jdbc2.jdbc.SybStatement.execute(SybStatement.java:1527)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.sybase.jdbc2.jdbc.SybStatement.execute(SybStatement.java:742)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.dcx.catl.macscompiler.util.CommonDataAccessManager.execQueryRetState(CommonDataAccessManager.java:759)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.dcx.catl.macscompiler.bo.RemoveIllustrationJavaBean.execute(RemoveIllustrationJavaBean.java:414)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.dcx.catl.macscompiler.ao.RemoveIllustrationAction.execute(RemoveIllustrationAction.java:219)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:446)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:266)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:948)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:530)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:176)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:201)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R      at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
    [4/27/05 17:02:50:031 IST] 575ee900 SystemErr R [4/27/05 17:02:50:031 IST] 575ee900 SystemOut O SQLException: The identifier that starts with '"T3211PU,,insert into Illustr' is too long. Maximum length is 28.

  • Syntax error in insert query

    I have a flash form that is used to inserts a record into an
    Access database table. In the for there are 4 datefields, several
    text input fields, and several select fields. When I submit the
    form, I get a syntax error that reads:
    Executing Database Query. [Macromedia][SequeLink JDBC
    Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver]
    Syntax error in INSERT INTO statement.
    The error occurred on line 184. Complex object types cannot
    be converted to simple values.
    Line 184 is the last line of the Values in the insert query.
    The query looks like this:
    <CFQUERY DATASOURCE="#REQUEST.DataSource#">
    INSERT INTO EstimateNumber(
    BidNumber,
    Project,
    JobSite,
    EstimatedBy,
    Region,
    Company,
    Division,
    InquiryNumber,
    SafetyChecklist,
    SafetyChecklistDate,
    QCChecklist,
    QCChecklistDate,
    EstimatedValue,
    UserUsername,
    UserPassword,
    Updated,
    ReviewDate,
    ReviewedBy,
    Discipline,
    BidDate,
    JobNumber,
    UpdatedBy
    VALUES(
    #FORM.BidNumber#,
    '#FORM.Project#',
    '#FORM.JobSite#',
    '#FORM.EstimatedBy#',
    #FORM.Region#,
    #FORM.Company#,
    #FORM.Division#,
    '#FORM.InquiryNumber#',
    #FORM.SafetyChecklist#,
    #FORM.SafetyChecklistDate#,
    #FORM.QCChecklist#,
    '#FORM.QCChecklistDate#',
    #FORM.EstimatedValue#,
    '#FORM.UserUsername#',
    '#FORM.UserPassword#',
    #FORM.Updated#,
    #FORM.ReviewDate#,
    #FORM.ReviewedBy#,
    #FORM.Discipline#,
    #FORM.BidDate#,
    #FORM.JobNumber#,
    '#FORM.UpdatedBy#'
    </CFQUERY>
    Any recomendations?

    Date/Time in Access provide some pretty strage hurdles. In
    many occassions I have simply changed the field to a Text field and
    ran with that and never seemed to have problems with the result. I
    didn't like doing it but I never received errors. I have been
    receiving some parameter errors with <cfqueryparam> like the
    database doesn't recognized the preceding declared field in the
    update or insert query. Here is an example of a wierd error with
    Access. I have 2 tables. One is for estimate numbers and the other
    is for sub estimate numbers that can be assigned to specific
    estimate numbers. If is actually a complicated explanation about
    what is taking place behind the doors on this. The concept is
    simple on the surface. Both tables have the same fields except the
    subestimate table has 1 extra for a user defined subestimate
    number. The only relation between the two will be the estimate
    number. This insert works fine.
    INSERT INTO EstimateNumber(
    BidNumber,
    Project,
    JobSite,
    EstimatedBy,
    Region,
    Company,
    Division,
    InquiryNumber,
    SafetyChecklist,
    SafetyChecklistDate,
    QCChecklist,
    QCChecklistDate,
    EstimatedValue,
    UserUsername,
    UserPassword,
    ReviewDate,
    Discipline,
    BidDate,
    JobNumber,
    UpdatedBy
    VALUES(
    #FORM.BidNumber#,
    '#FORM.Project#',
    '#FORM.JobSite#',
    '#FORM.EstimatedBy#',
    #FORM.Region#,
    #FORM.Company#,
    #FORM.Division#,
    '#FORM.InquiryNumber#',
    #FORM.SafetyChecklist#,
    <cfqueryparam
    value="#FORM.SafetyChecklistDate#"
    cfsqltype="CF_SQL_DATE "
    maxlength="50"
    >,
    #FORM.QCChecklist#,
    <cfqueryparam
    value="#FORM.QCChecklistDate#"
    cfsqltype="CF_SQL_DATE "
    maxlength="50"
    >,
    #FORM.EstimatedValue#,
    '#FORM.UserUsername#',
    '#FORM.UserPassword#',
    <cfqueryparam
    value="#FORM.ReviewDate#"
    cfsqltype="CF_SQL_DATE "
    maxlength="50"
    >,
    #FORM.Discipline#,
    <cfqueryparam
    value="#FORM.BidDate#"
    cfsqltype="CF_SQL_DATE "
    maxlength="50"
    >,
    #FORM.JobNumber#,
    '#FORM.UpdatedBy#'
    This next one is the same exact query with the same table
    setup with one added field but kicks back a parmeter error
    expecting 4. I can't explain it.
    INSERT INTO SubEstimate(SubBidNumber,
    BidNumber,
    Project,
    JobSite,
    EstimatedBy,
    Region,
    Company,
    Division,
    InquiryNumber,
    SafetyChecklist,
    SafetyChecklistDate,
    QCChecklist,
    QCChecklistDate,
    EstimatedValue,
    UserUsername,
    UserPassword,
    ReviewDate,
    Discipline,
    BidDate,
    JobNumber,
    UpdatedBy
    VALUES(#FORM.SubBidNumber#,
    #FORM.BidNumber#,
    '#FORM.Project#',
    '#FORM.JobSite#',
    '#FORM.EstimatedBy#',
    #FORM.Region#,
    #FORM.Company#,
    #FORM.Division#,
    '#FORM.InquiryNumber#',
    #FORM.SafetyChecklist#,
    <cfqueryparam
    value="#FORM.SafetyChecklistDate#"
    cfsqltype="CF_SQL_DATE "
    maxlength="50"
    >,
    #FORM.QCChecklist#,
    <cfqueryparam
    value="#FORM.QCChecklistDate#"
    cfsqltype="CF_SQL_DATE "
    maxlength="50"
    >,
    #FORM.EstimatedValue#,
    '#FORM.UserUsername#',
    '#FORM.UserPassword#',
    <cfqueryparam
    value="#FORM.ReviewDate#"
    cfsqltype="CF_SQL_DATE "
    maxlength="50"
    >,
    #FORM.Discipline#,
    <cfqueryparam
    value="#FORM.BidDate#"
    cfsqltype="CF_SQL_DATE "
    maxlength="50"
    >,
    #FORM.JobNumber#,
    '#FORM.UpdatedBy#'
    IF I get rid of the cfqueryparam fields it works. If I simply
    remove the param, I get a Syntax error. Needless to say I commented
    this query for the sake of sanity for the time being.

  • To check the success of failure of the insert query in JSP

    frendz,
    i am working with JSP .i have some content to be inserted in the database.i have used the insert query in SQL for that.i am able to check whether it has been inserted properly in the SQL but i want to check the status of the insert query with its return value(so that i can confirm it does not return a error).so please help.

    gymm wrote:
    This is not the right forum to ask technical questions. Please try the JSP forum:
    http://forum.java.sun.com/forum.jspa?forumID=45
    Where do you think that we are in? Didn't you mean the JDBC forum? It is here: http://forum.java.sun.com/forum.jspa?forumID=48
    Anyway, the topic continues here: http://forum.java.sun.com/thread.jspa?threadID=5257050

  • JDBC SQL Query Transactionality

    Hi Experts,
    If possible, please can you let me know how the JDBC SQL Query Transactionality works?
    For example, in the JDBC communication channel configuration parameters,
    if I use "SELECT * FROM orders WHERE new = 'TRUE' " for the select query and;
    if I use "UPDATE orders SET new = 'FALSE' WHERE new = 'TRUE' " for the update query;
    does the UPDATE query just update the records contained in that particular record set (for a particular polling instance)?
    What happens if someone inserts new records into the orders table just before the update query executes? Will the update query update those records too? Or just those records in the record set for a particular polling instance? How does XI/PI distinguish between the records contained in the record set for (for a particular polling instance) and the records inserted just before the update query executes?
    Thanks and regards,
    Brendon

    hi,
    as far as I remember this works correctly only when you set Transaction Isolation Levels to repeatable_read or serializable
    have a look at those levels :
    http://api.openoffice.org/docs/common/ref/com/sun/star/sdbc/TransactionIsolation.html
    so I guess both of them should prevent situations you're talking about
    Regards,
    Michal Krawczyk

  • Sql insert is hang/no respond

    hi
    i had writing a simple porgram to insert data into oracle database.
    my code like this
    Connection conn = ..
    Statement stat= ..
    stat.executeUpdate("select sysdate from dual") //this one ok
    but when i running like this
    stat.executeUpdate("insert ...") //this one not ok
    it just hang and no respond.
    my database is oracle 10g, driver version = 10.2.0.4.0
    any idea ?
    regards,
    kiwi

    Are you using username password for System? or any other user? First psosibility is the table was created in read-only mode if you think you have privileges to alter insert delte like that. Next is your insert query is wrong which you have not shown here. for which schema and table name.

  • Performance issues with respect scheme registration,select & insert query

    I am facing performance issues with respect to schema registration,Select & insert query towards 10.2.0.3 version.It is taking around 45 minutes to register schema and it is taking around 5 min to insert a single document into xml db where as it was taking less than min to insert a single document into xml db of 9.2.0.6 version.Would like to know the issue and solution to resolve this issue.Please help me out on this as it is very urgent for me

    Since it appears that this is an XML DB specific question, you're probably better off posting in the XML DB. The folks over there have much more experience with the ins and outs of that particular product.
    Justin

  • How can I insert Query in a Workbook

    Hi,
    I am new in BI 7.0. I am trying to insert a query in a workbook. but the tools button is not giving me the option to insert query like 3.X
    How can i insert query in 7.0
    Can anybody please give me the step by step instruction.
    Thanks in Advance

    1. Open BEx ANalyzer.
    2. Create new excel workbook by hitting the "New" icon in Excel.
    3. Logon to a backend BI system.
    4. Click the design mode icon.
    5. Put your mouse on a cell and insert a table.
    6. Assign a dataprovider to this table.
    7. Switch off design mode.
    Hope it Helps
    Chetan
    @CP..

  • How can I enter the data from the recordset into your insert query

    Hi
    i would like to know how I can enter the data from the recordset into your insert query without using a  hidden field.
    thanks
    ------------------------------------------------------------------------------------Below is the code------------------------------------------------------------------------------------- -----
    <?php require_once('../../Connections/ezzyConn.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
       $theValue = function_exists("mysql_real_escape_string") ?  mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "frmpostComment")) {
       $insertSQL = sprintf("INSERT INTO comments (com_topic, com_user, title,  com_content, com_date, online_id) VALUES (%s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['com_topic'], "int"),
                           GetSQLValueString($_POST['commentby'], "int"),
                           GetSQLValueString($_POST['title'], "text"),
                           GetSQLValueString($_POST['com_content'], "text"),
                           GetSQLValueString($_POST['com_date'], "text"),
                           GetSQLValueString($_POST['online_id'], "int"));
      mysql_select_db($database_ezzyConn, $ezzyConn);
      $Result1 = mysql_query($insertSQL, $ezzyConn) or die(mysql_error());
      $insertGoTo = "index.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $insertGoTo));
    $colname_rsCommentby = "-1";
    if (isset($_SESSION['MM_Username'])) {
      $colname_rsCommentby = $_SESSION['MM_Username'];
    mysql_select_db($database_ezzyConn, $ezzyConn);
    $query_rsTopics = "SELECT topic_id, topic FROM topics ORDER BY topic_date DESC";
    $rsTopics = mysql_query($query_rsTopics, $ezzyConn) or die(mysql_error());
    $row_rsTopics = mysql_fetch_assoc($rsTopics);
    $totalRows_rsTopics = mysql_num_rows($rsTopics);
    mysql_select_db($database_ezzyConn, $ezzyConn);
    $query_rsOnline = "SELECT online_id, `online` FROM `online` ORDER BY online_id DESC";
    $rsOnline = mysql_query($query_rsOnline, $ezzyConn) or die(mysql_error());
    $row_rsOnline = mysql_fetch_assoc($rsOnline);
    $totalRows_rsOnline = mysql_num_rows($rsOnline);
    $colname_rsCommentby = "-1";
    if (isset($_SESSION['MM_Username'])) {
      $colname_rsCommentby = $_SESSION['MM_Username'];
    mysql_select_db($database_ezzyConn, $ezzyConn);
    $query_rsCommentby  = sprintf("SELECT user_id, username FROM users WHERE username = %s",  GetSQLValueString($colname_rsCommentby, "text"));
    $rsCommentby = mysql_query($query_rsCommentby, $ezzyConn) or die(mysql_error());
    $row_rsCommentby = mysql_fetch_assoc($rsCommentby);
    $totalRows_rsCommentby = mysql_num_rows($rsCommentby);
    ?>
    <?php include("../includes/access.php"); ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>ezzybay - easy click, ezzy shopping</title>
    <link href="../css/global.css" rel="stylesheet" type="text/css" />
    <link href="../css/navigation.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="wrapper">
      <?php include("../includes/top.php"); ?>
      <div id="content">
      <div id="pageTitle">
        <h2>CMS Section:</h2>
        <p>Comment Topics Page</p>
      </div>
      <?php include("../includes/leftnav.php"); ?>
        <div id="mainContent">
          <form action="<?php echo $editFormAction; ?>" method="post" name="frmpostComment" id="frmpostComment">
            <table align="center">
            <caption>Post Comment</caption>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Topic:</td>
                <td><select name="com_topic" class="listbox" id="com_topic">
                  <?php
    do { 
    ?>
                   <option value="<?php echo  $row_rsTopics['topic_id']?>"><?php echo  $row_rsTopics['topic']?></option>
                  <?php
    } while ($row_rsTopics = mysql_fetch_assoc($rsTopics));
      $rows = mysql_num_rows($rsTopics);
      if($rows > 0) {
          mysql_data_seek($rsTopics, 0);
          $row_rsTopics = mysql_fetch_assoc($rsTopics);
    ?>
                </select></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Title:</td>
                <td><input name="title" type="text" class="textfield" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right" valign="top">Comment:</td>
                <td><textarea name="com_content" cols="50" rows="5" class="textarea"></textarea></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Status:</td>
                <td><select name="online_id" class="smalllistbox">
                  <?php
    do { 
    ?>
                   <option value="<?php echo $row_rsOnline['online_id']?>"  <?php if (!(strcmp($row_rsOnline['online_id'], 2))) {echo  "SELECTED";} ?>><?php echo  $row_rsOnline['online']?></option>
                  <?php
    } while ($row_rsOnline = mysql_fetch_assoc($rsOnline));
    ?>
                </select></td>
              </tr>
              <tr> </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right"> </td>
                <td><input type="submit" class="button" value="Insert record" /></td>
              </tr>
            </table>
            <input name="commentby" type="hidden" id="commentby" value="<?php echo $row_rsCommentby['user_id']; ?>" />
            <input type="hidden" name="com_date" value="<?php echo date("d/m/y : H:i:s", time()) ?>" />
            <input type="hidden" name="MM_insert" value="frmpostComment" />
          </form>
        </div>
      </div>
    <?php include("../includes/footer.php"); ?>
    </div>
    </body>
    </html>
    <?php
    mysql_free_result($rsTopics);
    mysql_free_result($rsOnline);
    mysql_free_result($rsCommentby);
    ?>

    I'll keep it simple and only use the date as an example. Hopefully you get the concept from the example. Basically you create a recordset and insert the recordset value instead of the POST value into your insert query. In the example below I declared a variable for $the_date and entered the variable into the INSERT query instead of the hidden POST field.
    <?php require_once('../../Connections/ezzyConn.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
       $theValue = function_exists("mysql_real_escape_string") ?  mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $the_date = date("d/m/y : H:i:s", time());
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "frmpostComment")) {
       $insertSQL = sprintf("INSERT INTO comments (com_topic, com_user, title,  com_content, com_date, online_id) VALUES (%s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['com_topic'], "int"),
                           GetSQLValueString($_POST['commentby'], "int"),
                           GetSQLValueString($_POST['title'], "text"),
                           GetSQLValueString($_POST['com_content'], "text"),
                           GetSQLValueString($the_date, "text"),
                           GetSQLValueString($_POST['online_id'], "int"));
      mysql_select_db($database_ezzyConn, $ezzyConn);
      $Result1 = mysql_query($insertSQL, $ezzyConn) or die(mysql_error());
      $insertGoTo = "index.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $insertGoTo));
    ?>

  • Use JDBC to query data for JSP Report

    Hi all,
    I met a trouble when use JDBC to query data,
    it can show data in report builder, but get error when call from url for exxample: http://localhost:8889/reports/TestJDBCReport.jsp
    found error message:
    javax.servlet.jsp.JspException: rwlib-1: REP-4100: Failed to execute data source. REP-0069: Internal error JDBCPDS-62000:Invalid sign-on parameter P_JDBCPDS
    javax.servlet.jsp.JspException: rwlib-1: REP-4100: Failed to execute data source.
    REP-0069: Internal error
    JDBCPDS-62000:Invalid sign-on parameter P_JDBCPDS
    anyone know pls help me
    Many thanks

    As a general rule, it's a good idea to separate the
    presentation (JSP and HTML) from the business rules
    (database access). I know you didn't do that on the
    AS/400, you had display files and business logic in
    the same program (at least, we certainly do in ours),
    but it's a good policy to follow in the web world.
    That means, don't put your database access code in
    the JSP. Other than that, it depends on the data.
    If you have simple data (e.g. customer's name and
    d address) then a Java bean would suffice. If you
    have complex data (e.g. customer's payment history)
    then a bean still might suffice. You would use an
    "include" if you had some data (static or dynamic)
    that you wanted to appear in several different pages
    in the same form.Thanks, I figured putting the code in the JSP was not the best way, but I wasn't sure about the other options.

  • Tools | Insert Query no longer supported with SAPBEX 7.0 ?

    Hi
    With SAPBEX for BW 3.5 we could use Tools | Insert Query ... in individual worksheets and then save this as a workbook. 
    Now for BW 7.0, the SAPBEX does not seem to be able to do this and the end-user must "paint" the query by inserting a navigation area, filter block and results area into the sheet and then bind these objects to an infoprovider.
    My users will struggle with this new method - has the Insert function been removed or is it hiding somewhere ?
    regards
    Ian MacLaren

    Hi,
    it's very borring to re-design a query for each sheet...
    So there is an helpful option :
    1) Open Bex Analyser
    2) Open your query
    3) DIsplay the Navigation pane (thanks to the button filter)
    4) In the navigation pane, right click on a caracteristic that is not display in your analysis grid yet
    5) choose the last option "Drill <name of the caracteristic> Across Sheets"
    6) It will duplicate the query for each value of the caracteristic, in a individual sheet for each value.
    (so... choose a caracteristic with less than 10 values)
    7) now you've got several sheets but no data.
    8) Refresh the workbook
    Now, you've got a workbook with several sheet with the same design.
    You just have to go in conception mode and change the dataprovider of the different object into each sheet.
    N.B : The button chart, filter, information doesn't work for news sheet...
    you will have to develop VBA macro or just use Excel function : Data > Group and Outline > Group... in order to hide and unhide lines and column quickly.
    Hope it's help
    Don't forget point.

  • Performance issue with insert query !

    Hi ,
    I am using dbxml-2.4.16, my node-storage container is loaded with a large document ( 54MB xml ).
    My document basically contains around 65k records in the same table ( 65k child nodes for one parent node ). I need to insert more records in to my DB, my insert XQuery is consuming a lot of time ( ~23 sec ) to insert one entry through command-line and around 50sec through code.
    My container is indexed with "node-attribute-equality-string". The insert query I used:
    insert nodes <NS:sampleEntry mySSIAddress='70011' modifier = 'create'><NS:sampleIPZone1Address>AABBCCDD</NS:sampleIPZone1Address><NS:myICMPFlag>1</NS:myICMPFlag><NS:myIngressFilter>1</NS:myIngressFilter><NS:myReadyTimer>4</NS:myReadyTimer><NS:myAPNNetworkID>ggsntest</NS:myAPNNetworkID><NS:myVPLMNFlag>2</NS:myVPLMNFlag><NS:myDAC>100</NS:myDAC><NS:myBcastLLIFlag>2</NS:myBcastLLIFlag><NS:sampleIPZone2Address>00000000</NS:sampleIPZone2Address><NS:sampleIPZone3Address>00000000</NS:sampleIPZone3Address><NS:sampleIPZone4Address>00000000</NS:sampleIPZone4Address><NS:sampleIPZone5Address>00000000</NS:sampleIPZone5Address><NS:sampleIPZone6Address>00000000</NS:sampleIPZone6Address><NS:sampleIPZone7Address>00000000</NS:sampleIPZone7Address></NS:sampleEntry> into doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:NS//NS:sampleTable)
    If I modify my query with
    into doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:sampleTable/NS:sampleEntry[@mySSIAddress='1']
    insted of
    into doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:NS//NS:sampleTable)
    Time taken reduces only by 8 secs.
    I have also tried to use insert "after", "before", "as first", "as last" , but there is no difference in performance.
    Is anything wrong with my query, what should be the expected time to insert one record in a DB of 65k records.
    Has anybody got any idea regarding this performance issue.
    Kindly help me out.
    Thanks,
    Kapil.

    Hi George,
    Thanks for your reply.
    Here is the info you requested,
    dbxml> listIndexes
    Index: unique-node-metadata-equality-string for node {http://www.sleepycat.com/2002/dbxml}:name
    Index: node-attribute-equality-string for node {}:mySSIAddress
    2 indexes found.
    dbxml> info
    Version: Oracle: Berkeley DB XML 2.4.16: (October 21, 2008)
    Berkeley DB 4.6.21: (September 27, 2007)
    Default container name: n_b_i_f_c_a_z.dbxml
    Type of default container: NodeContainer
    Index Nodes: on
    Shell and XmlManager state:
    Not transactional
    Verbose: on
    Query context state: LiveValues,Eager
    The insery query with update takes ~32 sec ( shown below )
    time query "declare namespace foo='MY-SAMPLE';declare namespace NS='NS';insert nodes <NS:sampleEntry mySSIAddress='70000' modifier = 'create' ><NS:sampleIPZone1Address>AABBCCDD</NS:sampleIPZone1Address><NS:myICMPFlag>1</NS:myICMPFlag><NS:myIngressFilter>1</NS:myIngressFilter><NS:myReadyTimer>4</NS:myReadyTimer><NS:myAPNNetworkID>ggsntest</NS:myAPNNetworkID><NS:myVPLMNFlag>2</NS:myVPLMNFlag><NS:myDAC>100</NS:myDAC><NS:myBcastLLIFlag>2</NS:myBcastLLIFlag><NS:sampleIPZone2Address>00000000</NS:sampleIPZone2Address><NS:sampleIPZone3Address>00000000</NS:sampleIPZone3Address><NS:sampleIPZone4Address>00000000</NS:sampleIPZone4Address><NS:sampleIPZone5Address>00000000</NS:sampleIPZone5Address><NS:sampleIPZone6Address>00000000</NS:sampleIPZone6Address><NS:sampleIPZone7Address>00000000</NS:sampleIPZone7Address></NS:sampleEntry> into doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:NS//NS:sampleTable"
    Time in seconds for command 'query': 32.5002
    and the query without the updation part takes ~14 sec ( shown below )
    time query "declare namespace foo='MY-SAMPLE';declare namespace NS='NS'; doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:NS//NS:sampleTable"
    Time in seconds for command 'query': 13.7289
    The query :
    time query "declare namespace foo='MY-SAMPLE';declare namespace NS='NS'; doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//PMB:sampleTable/PMB:sampleEntry[@mySSIAddress='1000']"
    Time in seconds for command 'query': 0.005375
    is very fast.
    The Updation of the document seems to consume much of the time.
    Regards,
    Kapil.

Maybe you are looking for

  • Battery drain after updating to iOS 5.1.1

    After doing the update to iOS 5.1.1 the phone is getting hot "warm" near the processor and the battery drains about 1% per 10 mins in standby and 10X when running an app. Meaning that the phone will run about 6 hours when it used to run for 48 hours

  • JTable: Custom Table Model (pI)

    This is a follow-up to thread http://forum.java.sun.com/thread.jspa?threadID=725162 and thread http://forum.java.sun.com/thread.jspa?threadID=725158. As I'm hoping to have a table of 5 columns, where the 4th and 5th columns are for integer and float

  • IDOCS IN HR MODULE

    Hi all, can any one please help me out on HR IDOCS. Actually iam very new to idocs. my requirement is when there is change in action type i need to send the action type ,reason for action and start date of the action fields to legacy system. The lega

  • Cursor Expression

    Is Cursor Expression in Select list  allowed in SQL Server?  

  • Toshiba forum registration issues

    Had quite a few problems when I tried to register for Toshiba forums: 1) Which forum - forums.toshiba.com seems to be completely separate registration from forums.computers.toshiba-europe.com - you can't use ID from toshiba.com on toshiba-europe.com?