JDBC preparedstatement

Hi all,
I am getting a exception when I run the following code:
"not all variables bound"
public void insertValues(Map values) throws SQLException{
String insertQuery="Insert into Music1(BandId, bandName, vocals,leadG, drums) values(?,?,?,?,?)" ;
pStmt = con.prepareStatement(insertQuery);
pStmt.setInt(1, ((Integer)values.get("bandId")).intValue() );
pStmt.setString(2, (String)values.get("bandName"));
pStmt.setString(3, (String)values.get("vocals"));
pStmt.setString(4, (String)values.get("leadG"));
pStmt.setString(5, (String)values.get("drums"));
int n = stmt.executeUpdate(insertQuery);
if(n > 0)
System.out.println(n + " rows inserted.");
I've set all the parameters in the preparedstatement.
Please help.....

delete the underlined. and run again
int n = stmt.executeUpdate(insertQuery);

Similar Messages

  • Failed to Load Oracle.jdbc.PreparedStatement

    Hi all,
    My application says
    "Failed to Load either oracle.jdbc.PreparedStatement or oracle.jdbc.driver.PreparedStatement .
    I have oracle driver in <server-instance>/lib directory.
    Anybody has an idea about this ?
    Thanks

    Hi,
    Here is the server.log meassage at fine Level
    11/Mar/2003:09:06:17] FINE (20766): Status to be set : 0
    [11/Mar/2003:09:06:17] FINE (20766): Invoked receivedReply()
    [11/Mar/2003:09:06:17] FINE (20766): ---SQLPersistenceManagerFactory: dbname = Oracle.[11/Mar/2003:09:06:17] FINE (20766): <-> DBVendorType(), vendorName = [ Oracle] propertyName: oracle short name: ORACLE.
    [11/Mar/2003:09:06:17] FINE (20766): --> DBVendorType.initialize().
    [11/Mar/2003:09:06:17] FINE (20766): --> DBVendorType.load() - resourceName: com/sun/jdo/spi/persistence/support/sqlstore/database/SQL92.properties , override: false.
    [11/Mar/2003:09:06:17] FINE (20766): --> DBVendorType.load() - resourceName: com/sun/jdo/spi/persistence/support/sqlstore/database/ORACLE.properties , override: false.
    [11/Mar/2003:09:06:17] FINE (20766): --> DBVendorType.load() - resourceName: .tpersistence.properties , override: true.
    [11/Mar/2003:09:06:17] FINE (20766): <-> DBVendorType.overrideProperties() - NONE.
    [11/Mar/2003:09:06:17] INFO (20766): Failed to load either oracle.jdbc.OraclePreparedStatement or oracle.jdbc.driver.OraclePreparedStatement. Oracle specific optimization will be disabled.
    [11/Mar/2003:09:06:17] FINE (20766): <-- DBVendorType.initialize().
    [11/Mar/2003:09:06:17] FINE (20766): ---SQLStoreManager: vendor type = ORACLE.
    [11/Mar/2003:09:06:18] FINE (20766): initializeServerLogger: javax.enterprise.resource.jdo.transaction com.sun.jdo.spi.persistence.support.sqlstore.Bundle null
    [11/Mar/2003:09:06:18] FINE (20766): initializeServerLogger: javax.enterprise.resource.jdo.transaction com.sun.jdo.spi.persistence.support.sqlstore.Bundle FINE

  • JDBC PreparedStatement Woes

    I'm having a heck of a time trying to figure out how to make prepared statements work with JDBC. We've got an IBM DB2 (V5.2) database running on a Solaris 7 box.
    We use a unique id in many of our tables that was defined like:
    create table phone(
    tech_id char(13) for bit data not null unique,
    Currently our programs do not use PreparedStatements, and work like this:
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT TECH_ID FROM PHONE WHERE "
    + "AREA_CODE = '701'");
    while(rs.next())
    String tech_id = rs.getString("tech_id");
    The above code will place something like: 19991229000416205209000000 in the variable tech_id. To use this tech_id in another query, I use code like:
    ResultSet rs = stmt.executeQuery("SELECT PREFIX,NUMBER FROM PHONE WHERE "
    + "TECH_ID = x'" + tech_id + "'");
    if(rs.next())
    System.out.println(rs.getString("prefix") + rs.getString("number"));
    Now, how would I go about doing the same thing using prepared statements?
    I would have expected:
    PreparedStatement ps = con.prepareStatement("SELECT PREFIX FROM PHONE "
    + "WHERE TECH_ID = ?");
    ps.setString(1, tech_id);
    ResultSet rs = ps.executeQuery();
    if(rs.next())
    System.out.println(rs.getString("prefix"));
    But, this code doesn't work. I throw and exception on the executeQuery(). Basically, I need assistance or direction for using this funky char(13) bit data data type in my jdbc programs.
    If anyone could offer pointers to URLs that contain this type of information, or maybe even post some examples, I would definately appreciate the help.
    Thanks a lot.

    Perhaps you should include the entire exception error thrown when you try to execute this PreparedStatement object. Usually, we can tell what was happening to the SQL query or what the JDBC connection was trying to get that caused the exception to be thrown.
    Your source code looks okay and there is no syntaxes or usage errors.
    So in summary, I think the members of this forum can help you further if you can include the error messages thrown by the VM.
    Allen Lai
    Sun Microsystems

  • JDBC PreparedStatement with Oracle 8.0.5 on Linux

    As the subject stated, I am using Oracle 8.0.5 on a Linux machine.
    When I am using a PreparedStatement, somehow, the binded variables are reversed in order.
    E.g.
    String sql = "INSERT INTO TABLE1 (X, Y) VALUES (?, ?)";
    PreparedStatement ps = conn.prepareStatement(sql);
    ps.setString(1, "1");
    ps.setString(2, "2");
    ps.executeUpdate();
    When I run the above, the insertion is successful. However, when I select the table, this is what I get.
    X Y
    2 1
    The values are reversed.
    This is the same for update statement too.
    If I do this,
    "UPDATE TABLE1 SET X = ? WHERE Y = ?"
    ps.setString (1, "3");
    ps.setString (2, "1");
    The above will not be successful.
    If I do this,
    ps.setString (2, "3");
    ps.setString (1, "1");
    The above is successful.
    Somehow the order of the binded variable get messed up.
    Does anyone has any idea why?

    The datatype of X and Y are both VARCHAR2(10) in this case.
    Even if they are numbers, they have the same problem. The order get reversed and the data inserted is incorrect.
    E.g. I have column M VARCHAR2(10) and column N NUMBER (2) in TABLE2.
    String sql = "INSERT INTO TABLE2 (M, N) VALUES (?, ?)";
    PreparedStatement ps = conn.prepareStatement(sql);
    ps.setString(1, "one");
    ps.setInt(2, 1);
    ps.executeUpdate();
    The insert operation is still successful. But when you select it becomes,
    M N
    ? 0
    This is because the order of the variables get reversed again.
    Forgot to mention that if we have used Statement instead of PreparedStatement, we will not have such problem.
    E.g. Statement stmt = conn.createStatement();
    String sql = "INSERT INTO TABLE2 (M, N) VALUES ('one', 1)";
    stmt.executeUpdate(stmt);
    The above will insert fine and when we do a select, the result is correct.
    M N
    one 1
    Though the above works fine, I still prefer to use PreparedStatement because of performance issue. So anyone has any idea what exactly is happening?
    Hmmm, this ones a strange one.
    What type are X and Y in the database? If they are of
    type NUMBER why not try something like.
    ps.setInt(1, 1);
    OR
    ps.setLong(2, 2);
    and see if that makes any difference.

  • JDBC error in PreparedStatement using TimesTen 6.0.3

    TimesTen supports this kind of sql statement
    select rows 3 to 5 * from products
    (it returns 2 rows started from row #3)
    I want to implement this in java thru JDBC
    PreparedStatement pstmt = con.prepareStatement(select rows ? to ? * from products);
    pstmt.setInt(1,3);
    pstmt.setInt(2,2);
    However, I got a JDBC error in the PreparedStatement line
    java.sql.SQLException: [TimesTen][TimesTen 6.0.3 ODBC Driver][TimesTen]TT1001: Syntax error in SQL statement before or at: "?", character position: 13 -- file "ptSqlY.y", lineno 1955, procedure "sbPtParseSql()"
    Anyone encounter this kind of error before? How to solve it?
    Thanks!
    Wellwin
    P.S. I am running this in Linux platform with JDBC driver come with TimesTen for java 1.4

    Hi Wellwin,
    Using SELECT ROWS m to n, you cannot parameterise m or n in order to provide them at execution time. They have to be explicitly stated as literals in the statement…
    If you need to use this with several different values for ‘m’ and ‘n’, there are a couple of options:
    1) Prepare (and subsequently execute) a different prepared statement for each combination of ‘m’ and ‘n’ that you need. This may be fine if there are only a small number of combinations but not a good choice if there are many combinations.
    2) Just use a regular SELECT (without the ROWS m TO n clause) and ‘skip’ the rows in the application code.
    Simon

  • PreparedStatment creating Syntax Error.

    The poblem is in the first prepared statment if I enter the value straight into the statement string everying works fine. However, when I use a ? for placeholder and then supply the same sting value i would have entered in the statement string I get a sytax error.
    import java.sql.*; import javax.swing.*; import java.awt.BorderLayout; import java.awt.event.*; public class Exercise34_5 extends JFrame { private JTextField jtfInput = new JTextField(10); private JButton jbShowTable = new JButton("Show Table"); private JTextArea jta = new JTextArea(); private PreparedStatement pstmt1; private PreparedStatement pstmt2; private PreparedStatement pstmt3; public Exercise34_5() { JPanel northPanel = new JPanel(); northPanel.add(new JLabel("Table Name")); northPanel.add(jtfInput); northPanel.add(jbShowTable); add(northPanel, BorderLayout.NORTH); add(new JScrollPane(jta)); try { Class.forName("com.mysql.jdbc.Driver"); Connection connection = DriverManager.getConnection("jdbc:mysql://localhost/test" , "root", "root"); pstmt1 = connection.prepareStatement("describe ?"); pstmt2 = connection.prepareStatement("select count(*) from enrollment"); pstmt3 = connection.prepareStatement("select * from enrollment"); }catch(Exception ex) { ex.printStackTrace(); } jbShowTable.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String table = jtfInput.getText(); try{ pstmt1.setString(1, "enrollment"); /*pstmt2.setString(1, "enrollment"); pstmt3.setString(1, "enrollment");*/ ResultSet rset1 = pstmt1.executeQuery(); ResultSet rset3 = pstmt3.executeQuery(); int count = 0; while(rset1.next()) { jta.append(rset1.getString(1) + "\t"); count++; } jta.append("\n"); System.out.println(count); while(rset3.next()) { for(int i = 1; i <= count; i++) { jta.append(rset3.getString(i) + "\t"); } jta.append("\n"); } }catch(Exception ex) { ex.printStackTrace(); } } }); } public static void main(String[] args) { Exercise34_5 frame = new Exercise34_5(); frame.setSize(400, 200); frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(EXIT_ON_CLOSE); frame.setVisible(true); } }
    java.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 ''enrollment'' at line 1"
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1997)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1167)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1278)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:2251)
    at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1586)
    at Exercise34_5$1.actionPerformed(Exercise34_5.java:47)

    Alyosha wrote:
    I don't understand.You can't just put a ? parameter any old place in a prepared statement. It's just just a simple string substitution. For instance, you cannot use a ? parameter for a table name or a column name.
    // wrong
    ps = conn.prepareStatement("select * from ? where ? = ?");
    ps.setString(1, tableName);
    ps.setString(2, columnName);
    ps.setString(3, columnValue);
    // right
    ps = conn.prepareStatement("select * from " + tableName = " where " + columnName + " = ?");
    ps.setString(1, columnValue);

  • PreparedStatements and MySQL Connector/J

    Hi All,
    I was wondering what is the exact SQL statement that is passed to MySQL server when we use PreparedStatements. I was trying using MySQL Connector/J, type4 driver. I tried with a simple servlet
        public void doGet(HttpServletRequest request, HttpServletResponse response)
        throws IOException, ServletException   {
            response.setContentType("text/html");
            PrintWriter out = response.getWriter();
            out.println("<html>");
            out.println("<body>");
            out.println("<head>");
              try {
                   Class.forName("com.mysql.jdbc.Driver");
                   Connection con=DriverManager.getConnection("jdbc:mysql://localhost/mydb?user=root","root","");
                   //Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   //Connection con=DriverManager.getConnection("jdbc:odbc:test");
                   PreparedStatement pst=con.prepareStatement("select * from AS_ITM where ID_ITM=?");
                   out.println("PreparedStatement = "+pst);
                   out.println("<br>");
                   pst.setString(1, "10");
                   out.println("PreparedStatement = "+pst);
                   //ResultSet rs=pst.executeQuery();
                   con.close();
              }catch(Exception e){
                   out.println(e);
            out.println("</head>");
            out.println("<body>");
            out.println("</body>");
            out.println("</html>");
    Here I am printing PreparedStatement  object's generated SQL twice and not even executing the query.
    And the result is:
    PreparedStatement = com.mysql.jdbc.PreparedStatement@19f3736: select * from AS_ITM where ID_ITM=** NOT SPECIFIED **
    PreparedStatement = com.mysql.jdbc.PreparedStatement@19f3736: select * from AS_ITM where ID_ITM='10'
    See second statement? I have not even sent it to the server.
    So is this jdbc driver preparing a simple Statement before it is sent to MySQL server?
    Is it what a jdbc driver is supposed to do? So then whats the use of PreparedStatement?Thanks,
    Kishor

    Hi,
    Just exactly what a JDBC driver is supposed to do with a PreparedStatement is not specified in JDBC I believe. I think they only requirement is that a PreparedStatement should be able to insert the various data types correctly into an SQL string.
    I am fully aware that PreparedStatements should also be able to give a better performance, for instance by only sending the parameters when you use it the second time, and not the whole the SQL. But I think this is up to the database and driver implementation to decide whether to do this, and how.
    Remember, the JDBC driver may be sending other information across to the database than the SQL. We can't see that from looking at the PreparedStatement only. You would have to use a network packet sniffer to see all data exchanged between the driver and the database
    -Jakob Jenkov

  • Some indexes not used in JDBC call

    Hello everyone,
    I'm having a problem where a JDBC PreparedStatement without bind parameters can take more than a minute to execute a query that takes less than a second to execute in SQL*Plus. The query is identical, the database instance is the same, neither query is cached, and the query returns only 18 records with 11 columns all of which are either VARCHAR2 or NUMBER. I'm using Oracle's JDBC 2.0 drivers (classes12.jar) and Oracle 8i (Release 8.1.7.4.0) database. Oracle DB is set to use the cost-based optimizer.
    I did an explain plan in SQL*Plus and via JDBC. It turns out that some of the unique indexes that are used when executing the query in SQL*Plus are not used when executing via JDBC.
    Does anyone know why this would happen?
    Thanks,
    Jeff

    since you use a bind variable,oracle's cost based
    optimizer can not decide correctly whether to use
    this index is a good idea.The OP said he was NOT using bind variables in the testing within the SQL String of the PreparedStatement so this comment doesn't address his current problem.
    To the OP:
    Sounds like you have an Oracle permissions issue not related to JDBC specifically. Shouldn't be to hard to determine what the permission differences are between the two userids.
    Regarding proper use of PreparedStatement
    ALWAYS use PreparedStatement and host variables. There are 100's if not 1000's of posts documentation why this is a good idea here on the forums. Here are a couple of reasons why PreparedStatement with Host variables is a good idea.
    1) PreparedStatement using host variables will provide you best overall system performance.
    2) PreparedStatement using host variables eliminates the very real security risk of SQL injection.
    3) PreparedStatement using host variables aids the programmer in handling escape sequence and the frequent errors associated with special characters within SQL strings.
    4) PreparedStatement using host variables allows JDBC to take care of the majority of data conversions between Java and your database simplifying and standardizing data conversion coding
    There are isolated cases where using Host variables impedes performance when compared against dynamic SQL (SQL with literals) but they are few and far between (1: 1000?) and the standard should be to always use PreparedStatement with host variables.
    Good luck on resolving your current problem and remember to always use PreparedStatements WITH host variables when coding in Java!
    WFF

  • Using mysql jdbc driver leads to exception

    I try to use com.mysql.jdbc.Driver with JDeveloper 9i business components. The following is the code I use to test if mysql driver works with business components:
    package test;
    import oracle.jbo.*;
    import java.util.Hashtable;
    import javax.naming.*;
    public class Test { 
    public static void main(String[] args) {   
    final String amName = "test.TestModule";
    final String voName = "test.TesttableView";
    final String userName = "some_user";
    final String password = "some_password";
    final String connStr = "jdbc:mysql://localhost:3306/test";
    System.setProperty("jdbc.drivers", "com.mysql.jdbc.Driver");
    Hashtable env = new Hashtable(2);
    env.put(Context.INITIAL_CONTEXT_FACTORY, JboContext.JBO_CONTEXT_FACTORY);
    env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
    ApplicationModule appMod = null;
    try {     
    javax.naming.Context ic = new InitialContext(env);
    ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup(amName);
    appMod = home.create();
    java.util.Properties props = new java.util.Properties();
    props.put("user",userName);
    props.put("password",password);
    props.put("defaultRowPrefetch","15");
    appMod.getTransaction().connect(connStr, props);
    } catch(Exception e) {     
    e.printStackTrace();
    ViewObject vo = appMod.createViewObject("vo", voName);
    Row r = vo.first();
    r.setAttribute("Testcolumn", "Some text");
    System.out.println("vo before AppMod post " + r.getAttribute("Testcolumn"));
    try {   
    appMod.getTransaction().commit();
    System.out.println("Commit succeeded.");
    } catch (oracle.jbo.JboException e) {   
    System.out.println("Commit failed. " + e);
    r = vo.first();
    System.out.println("vo after AppMod commit " + r.getAttribute("Testcolumn"));
    Everything works fine until ViewObject.first() is called, then the following exception is thrown:
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.lang.ClassCastException, msg=com.mysql.jdbc.PreparedStatement
         void oracle.jbo.JboException.<init>(java.lang.Throwable)
              JboException.java:344
         oracle.jbo.Row oracle.jbo.server.ViewRowSetIteratorImpl.first()
              ViewRowSetIteratorImpl.java:1156
         oracle.jbo.Row oracle.jbo.server.ViewRowSetImpl.first()
              ViewRowSetImpl.java:2240
         oracle.jbo.Row oracle.jbo.server.ViewObjectImpl.first()
              ViewObjectImpl.java:4345
         void test.Test.main(java.lang.String[])
              Test.java:32
    ## Detail 0 ##
    java.lang.ClassCastException: com.mysql.jdbc.PreparedStatement
         void oracle.jbo.server.OracleSQLBuilderImpl.doStatementSetRowPrefetch(java.sql.Statement, int)
              OracleSQLBuilderImpl.java:894
         java.sql.PreparedStatement oracle.jbo.server.DBTransactionImpl.createPreparedStatement(java.lang.String, int)
              DBTransactionImpl.java:2695
         java.sql.PreparedStatement oracle.jbo.server.DBTransactionImpl2.createPreparedStatement(java.lang.String, int)
              DBTransactionImpl2.java:418
         java.sql.PreparedStatement oracle.jbo.server.DBTransactionImpl.createReUsePreparedStatement(java.lang.String, int)
              DBTransactionImpl.java:3467
         java.sql.PreparedStatement oracle.jbo.server.ViewObjectImpl.getPreparedStatement(int, boolean[])
              ViewObjectImpl.java:6496
         void oracle.jbo.server.QueryCollection.executeQuery(java.lang.Object[], int)
              QueryCollection.java:483
         void oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(java.lang.Object, java.lang.Object[], int)
              ViewObjectImpl.java:2600
         void oracle.jbo.server.ViewRowSetImpl.execute(boolean, boolean)
              ViewRowSetImpl.java:521
         void oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed()
              ViewRowSetIteratorImpl.java:2197
         oracle.jbo.Row oracle.jbo.server.ViewRowSetIteratorImpl.first()
              ViewRowSetIteratorImpl.java:1141
         oracle.jbo.Row oracle.jbo.server.ViewRowSetImpl.first()
              ViewRowSetImpl.java:2240
         oracle.jbo.Row oracle.jbo.server.ViewObjectImpl.first()
              ViewObjectImpl.java:4345
         void test.Test.main(java.lang.String[])
              Test.java:32
    Exception in thread main.
    Is there anyone who would be able to help me with this problem?
    Thank you in advance!

    Use
    Class.forName("com.mysql.jdbc.Driver");Is the MySQL JDBC JAR file listed in project path.?

  • Query Filter JDBC

    I had the following problem: I had to do queries with JDBC but if the user insert sql reserved word or commas, the system trows an error becose de sql sentence is incorrect. Somebody know any filter for this question.
    Thank you.

    And be sure you read up on how to set bind variables in the PreparedStatement. It will do you no good whatsoever to simply change the type of Statement. There are dozens of JDBC PreparedStatement examples. Be sure all your bind variables in your SQL statement are replaced with '?'.
    - Saish

  • Java.io.EOFException at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1956)

    Hi,All
    Need Help regarding the exception.
    As i tried so many way to solve this problem but cound'nt find out the solution.!!! If i restart the server then this error is resolved but for the some time.,after 4-5 hour again i need to restart the server.
    so please help me out from this problem!!!!!!
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: #{cityf.OrderToConsumerCity}: javax.faces.el.EvaluationException: org.hibernate.exception.JDBCConnectionException: could not execute query
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:225)
         org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
         org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
    root cause
    javax.faces.FacesException: #{cityf.OrderToConsumerCity}: javax.faces.el.EvaluationException: org.hibernate.exception.JDBCConnectionException: could not execute query
         com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:98)
         javax.faces.component.UICommand.broadcast(UICommand.java:332)
         org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
         org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
         org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:346)
         com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
         com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
         org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
         org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
    root cause
    javax.faces.el.EvaluationException: org.hibernate.exception.JDBCConnectionException: could not execute query
         com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:150)
         com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92)
         javax.faces.component.UICommand.broadcast(UICommand.java:332)
         org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
         org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
         org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:346)
         com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
         com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
         org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
         org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
    root cause
    org.hibernate.exception.JDBCConnectionException: could not execute query
         org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74)
         org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
         org.hibernate.loader.Loader.doList(Loader.java:2223)
         org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
         org.hibernate.loader.Loader.list(Loader.java:2099)
         org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:912)
         org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
         org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
         org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
         com.etelic.dao.ConsumerDAOHibernate.getCityList(ConsumerDAOHibernate.java:153)
         com.etelic.controller.City.OrderToConsumerCity(City.java:286)
         sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         java.lang.reflect.Method.invoke(Unknown Source)
         com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
         com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92)
         javax.faces.component.UICommand.broadcast(UICommand.java:332)
         org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
         org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
         org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:346)
         com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
         com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
         org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
         org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
    root cause
    com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: No operations allowed after connection closed.Connection was implicitly closed due to underlying exception/error:
    ** BEGIN NESTED EXCEPTION **
    com.mysql.jdbc.CommunicationsException
    MESSAGE: Communications link failure due to underlying exception:
    ** BEGIN NESTED EXCEPTION **
    java.io.EOFException
    STACKTRACE:
    java.io.EOFException
         at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1956)
         at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2368)
         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2867)
         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1616)
         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1708)
         at com.mysql.jdbc.Connection.execSQL(Connection.java:3255)
         at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1293)
         at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1428)
         at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
         at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
         at org.hibernate.loader.Loader.doQuery(Loader.java:674)
         at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
         at org.hibernate.loader.Loader.doList(Loader.java:2220)
         at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
         at org.hibernate.loader.Loader.list(Loader.java:2099)
         at org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:912)
         at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
         at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
         at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
         at com.etelic.dao.ConsumerDAOHibernate.getDelhiLocalityListByPincode(ConsumerDAOHibernate.java:116)
         at com.etelic.bo.ConsumerBO.getDelhiLocalityListByPincode(ConsumerBO.java:44)
         at com.etelic.manager.ConsumerManager.getDelhiLocalityList(ConsumerManager.java:38)
         at com.etelic.controller.ConsumerSearchParametersInput.search(ConsumerSearchParametersInput.java:275)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92)
         at javax.faces.component.UICommand.broadcast(UICommand.java:332)
         at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
         at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
         at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:346)
         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
         at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
         at java.lang.Thread.run(Unknown Source)
    ** END NESTED EXCEPTION **
    Last packet sent to the server was 15 ms ago.
    STACKTRACE:
    com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
    ** BEGIN NESTED EXCEPTION **
    java.io.EOFException
    STACKTRACE:
    *java.io.EOFException*
    *     at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1956)*     at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2368)
         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2867)
         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1616)
         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1708)
         at com.mysql.jdbc.Connection.execSQL(Connection.java:3255)
         at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1293)
         at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1428)
         at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
         at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
         at org.hibernate.loader.Loader.doQuery(Loader.java:674)
         at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
         at org.hibernate.loader.Loader.doList(Loader.java:2220)
         at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
         at org.hibernate.loader.Loader.list(Loader.java:2099)
         at org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:912)
         at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
         at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
         at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
         at com.etelic.dao.ConsumerDAOHibernate.getDelhiLocalityListByPincode(ConsumerDAOHibernate.java:116)
         at com.etelic.bo.ConsumerBO.getDelhiLocalityListByPincode(ConsumerBO.java:44)
         at com.etelic.manager.ConsumerManager.getDelhiLocalityList(ConsumerManager.java:38)
         at com.etelic.controller.ConsumerSearchParametersInput.search(ConsumerSearchParametersInput.java:275)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92)
         at javax.faces.component.UICommand.broadcast(UICommand.java:332)
         at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
         at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
         at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:346)
         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
         at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
         at java.lang.Thread.run(Unknown Source)
    ** END NESTED EXCEPTION **
    Last packet sent to the server was 15 ms ago.
         at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2579)
         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2867)
         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1616)
         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1708)
         at com.mysql.jdbc.Connection.execSQL(Connection.java:3255)
         at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1293)
         at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1428)
         at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
         at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
         at org.hibernate.loader.Loader.doQuery(Loader.java:674)
         at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
         at org.hibernate.loader.Loader.doList(Loader.java:2220)
         at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
         at org.hibernate.loader.Loader.list(Loader.java:2099)
         at org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:912)
         at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
         at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
         at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
         at com.etelic.dao.ConsumerDAOHibernate.getDelhiLocalityListByPincode(ConsumerDAOHibernate.java:116)
         at com.etelic.bo.ConsumerBO.getDelhiLocalityListByPincode(ConsumerBO.java:44)
         at com.etelic.manager.ConsumerManager.getDelhiLocalityList(ConsumerManager.java:38)
         at com.etelic.controller.ConsumerSearchParametersInput.search(ConsumerSearchParametersInput.java:275)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92)
         at javax.faces.component.UICommand.broadcast(UICommand.java:332)
         at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
         at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
         at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:346)
         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
         at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
         at java.lang.Thread.run(Unknown Source)
    ** END NESTED EXCEPTION **
         com.mysql.jdbc.SQLError.createSQLException(SQLError.java:888)
         com.mysql.jdbc.Connection.checkClosed(Connection.java:1931)
         com.mysql.jdbc.Connection.prepareStatement(Connection.java:4720)
         com.mysql.jdbc.Connection.prepareStatement(Connection.java:4686)
         org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:505)
         org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:423)
         org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
         org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
         org.hibernate.loader.Loader.doQuery(Loader.java:673)
         org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
         org.hibernate.loader.Loader.doList(Loader.java:2220)
         org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
         org.hibernate.loader.Loader.list(Loader.java:2099)
         org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:912)
         org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
         org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
         org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
         com.etelic.dao.ConsumerDAOHibernate.getCityList(ConsumerDAOHibernate.java:153)
         com.etelic.controller.City.OrderToConsumerCity(City.java:286)
         sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         java.lang.reflect.Method.invoke(Unknown Source)
         com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
         com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92)
         javax.faces.component.UICommand.broadcast(UICommand.java:332)
         org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
         org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
         org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:346)
         com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
         com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
         org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
         org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
    note The full stack trace of the root cause is available in the Apache Tomcat/6.0.14 logs.
    Apache Tomcat/6.0.14-Thanks and regards
    Praveen Soni

    Hey BalusC
    As i already obtain a new session object from sessionfactory,for one or more transactions at once(!),
    For reference see below code:
    package com.dao>hibenateUtil;
    import java.util.*;
    import com.ConsumerRecord;
    public class ConsumerDAOHibernate implements IConsumerDAO {
         public Long getNumberMatchingQuery(ConsumerRecord upr){
             String query = new String();
            String queryStart = "select count(*) FROM person in CLASS com.ConsumerRecord";
            query += queryStart;
            org.hibernate.Query q = HibernateUtil.getSession().createQuery(query);
            return (Long)q.uniqueResult();
        public Long getNumberMatchingCity(ConsumerRecord upr){
             String query = new String();
            String queryStart = "select count(*) FROM city in CLASS com.ConsumerRecord";
            query += queryStart;
            org.hibernate.Query q = HibernateUtil.getSession().createQuery(query);
            return (Long)q.uniqueResult();
    Hibernate Util:-package com.dao;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import org.apache.log4j.Logger;
    import org.hibernate.Session;
    import org.hibernate.SessionFactory;
    import org.hibernate.cfg.Configuration;
    public class HibernateUtil {
        private static final SessionFactory sessionFactory;
        private static Session  session = null;
        private static Logger logger = Logger.getLogger(HibernateUtil.class.getName());
        static {
            try {
                /** TODO: change to IOC w/ datasource */
                Configuration conf = new Configuration();
                sessionFactory = conf.configure().buildSessionFactory();
            } catch (Throwable ex) {
                // Make sure you log the exception, as it might be swallowed
                System.err.println("Initial SessionFactory creation failed." + ex);
                throw new ExceptionInInitializerError(ex);
        public static Session getSession() {
            if(session == null){
                try {
                    session = sessionFactory.openSession();   
                    logger.debug("****************************new session being created**************************************");
                               //sessionFactory.
                } catch (Throwable ex) {
                    // Make sure you log the exception, as it might be swallowed
                    System.err.println("Initial SessionFactory creation failed." + ex);
                    throw new ExceptionInInitializerError(ex);
            return session;
        }

  • Parameters on Oracle JDBC URL

    I wonder if anyone can help.
    I am writing a Java class which uses a JDBC PreparedStatement object to call a stored procedure on an Oracle database.
    To create the PreparedStatement object I use the prepareStatement method of the Connection object.
    I do not create the Connection object - this is important - it is passed into my method by another piece of code I cannot change.
    I need to specify some connection properties - specifically 'SetBigStringTryClob'. All the documentation I can find says that properties such as this can be passed to the Connection when it is created via a Properties object like this:
    // Load the database details into the variables.
    String url = "jdbc:oracle:thin:@localhost:1521:orcl";
    String user = "scott";String password = "tiger";
    // Create the properties object that holds all database details
    Properties props = new Properties();
    props.put("user", user );
    props.put("password", password);
    props.put("SetBigStringTryClob", "true");
    // Load the Oracle JDBC driver class.
    DriverManager.registerDriver(new OracleDriver());
    // Get the database connection
    Connection conn = DriverManager.getConnection( this.url, this.props );
    I cant do this as I dont create the Connection object. What I can do is specify the URL, so I'm thinking I should be able to specify my connection properities as url parameters - but I cant get it to work and I cant find anything anywhere that tells me how to do it.
    Any ideas?
    Alternatively I'm thinking that maybe there is a method of Connection where I can specify these properties - essentially after its been created - but again, I cant find anything
    Any help with this would be very much appreciated;
    Cheers
    Nathan

    Can you use the 11g drivers?
    See http://download.oracle.com/docs/cd/B28359_01/java.111/b31224/oralob.htm#CHDGJJDD
    Specifically the Input section
    Otherwise, is there any reason not to use the Oracle specific extensions? i.e. setStringForClob()

  • External JDBC Connexion to Mysql in BAM Server 11g

    Hi,
    I try to create an external datasource to a Mysql Server.
    When I test it, it runs well.
    I create a data object using this external datasource, I can "Browse" all tables of the MySQL schema.
    But when I try to see the CONTENT of my Data Object, I have this message :
    BAM-01262: Active Data Cache server exception in openViewset().
    Source: "ActiveDataCache" ID: "ADCServerException"
    Erreur de syntaxe près de '"flyspray_projects"' à la ligne 1
    Source: "com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Erreur de syntaxe près de '"flyspray_projects"' à la ligne 1"
    In the nohup file of the server, I can see this message :
    SEVERE: ActiveDataCache: Exception occurred in method openViewset(_TestFSListProjet,0)
    Exception: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Erreur de syntaxe près de "flyspray_projects" à la ligne 1
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:930)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2864)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1567)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1659)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:3118)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1143)
    at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1256)
    at oracle.bam.adc.common.externaldatasources.JDBC.getDataReader(JDBC.java:335)
    at oracle.bam.adc.kernel.datasets.ExternalStorageEngine.getDataReader(ExternalStorageEngine.java:76)
    at oracle.bam.adc.kernel.viewsets.utilities.externaldata.DataImporter.executeQuery(DataImporter.java:95)
    at oracle.bam.adc.kernel.viewsets.utilities.externaldata.ExternalDataManager.importExternalData(ExternalDataManager.java:233)
    at oracle.bam.adc.kernel.viewsets.utilities.externaldata.ExternalDataManager.importExternalFactData(ExternalDataManager.java:156)
    at oracle.bam.adc.kernel.viewsets.utilities.externaldata.ExternalDataManager.getExternalData(ExternalDataManager.java:108)
    at oracle.bam.adc.kernel.viewsets.Viewset.loadData(Viewset.java:259)
    at oracle.bam.adc.kernel.viewsets.ViewsetBase.initialize(ViewsetBase.java:169)
    at oracle.bam.adc.kernel.viewsets.Viewset.initialize(Viewset.java:220)
    at oracle.bam.adc.kernel.viewsets.ViewsetBase.open(ViewsetBase.java:152)
    at oracle.bam.adc.kernel.viewsets.ViewsetManager.initViewset(ViewsetManager.java:368)
    at oracle.bam.adc.kernel.viewsets.ViewsetManager.openViewset(ViewsetManager.java:361)
    at oracle.bam.adc.kernel.server.DataStoreServer.openViewset(DataStoreServer.java:1072)
    at oracle.bam.adc.ejb.BamAdcServerBean.openViewset(BamAdcServerBean.java:894)
    at sun.reflect.GeneratedMethodAccessor360.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at com.bea.core.repackaged.springframework.jee.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:104)
    at oracle.bam.adc.ejb.BamAdcServerBean.interceptor(BamAdcServerBean.java:263)
    at sun.reflect.GeneratedMethodAccessor356.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    at com.bea.core.repackaged.springframework.jee.intercept.JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:69)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.jee.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:104)
    at oracle.security.jps.wls.JpsWlsEjbInterceptor$1.run(JpsWlsEjbInterceptor.java:88)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    at oracle.security.jps.wls.util.JpsWlsUtil.runJaasMode(JpsWlsUtil.java:146)
    at oracle.security.jps.wls.JpsWlsEjbInterceptor.intercept(JpsWlsEjbInterceptor.java:106)
    at oracle.security.jps.ee.ejb.JpsInterceptor.intercept(JpsInterceptor.java:106)
    at sun.reflect.GeneratedMethodAccessor355.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    at com.bea.core.repackaged.springframework.jee.intercept.JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:69)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
    at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
    at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy197.openViewset(Unknown Source)
    at oracle.bam.adc.ejb.BamAdcServerBean_wf34ei_BamAdcServerRemoteImpl.openViewset(BamAdcServerBean_wf34ei_BamAdcServerRemoteImpl.java:3231)
    at oracle.bam.adc.api.client.BamAdcClient.openViewset(BamAdcClient.java:930)
    at sun.reflect.GeneratedMethodAccessor359.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at oracle.bam.common.remoting.BamEjbProxy.invoke(BamEjbProxy.java:209)
    at $Proxy196.openViewset(Unknown Source)
    at oracle.bam.adc.api.viewsets.Viewset.open(Viewset.java:75)
    at oracle.bam.web.architect.DataObjectsContents.internalContentsByRowID(DataObjectsContents.java:582)
    at oracle.bam.web.architect.DataObjectsContents.contentsByRowID(DataObjectsContents.java:463)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at oracle.bam.web.shared.WebPage.invokeWebMethod(WebPage.java:496)
    at oracle.bam.web.shared.WebPage.processRequest(WebPage.java:430)
    at oracle.bam.web.shared.WebPage.processRequest(WebPage.java:312)
    at jsp_servlet._6512._architect.__default._jspService(__default.java:71)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.wls.JpsWlsFilter$1.run(JpsWlsFilter.java:96)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    at oracle.security.jps.wls.util.JpsWlsUtil.runJaasMode(JpsWlsUtil.java:146)
    at oracle.security.jps.wls.JpsWlsFilter.doFilter(JpsWlsFilter.java:140)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.bam.web.cache.ClientSideCache.doFilter(ClientSideCache.java:93)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.bam.web.filters.GZIPFilter.doFilter(GZIPFilter.java:86)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.bam.web.filters.ValidateBrowserSession.doFilter(ValidateBrowserSession.java:213)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.bam.web.redirect.Redirect.doFilter(Redirect.java:79)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.bam.web.filters.ValidateBrowserSupport.doFilter(ValidateBrowserSupport.java:133)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.bam.web.filters.CharsetFixupFilter.doFilter(CharsetFixupFilter.java:65)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:202)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3588)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2200)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2106)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1428)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Does any body have an idea to solve this problem ?
    In advance,
    Thanks,
    Jerome

    Answer of the Second question.
    2. Can you please check the data types of the columns of the MySQL table and test again one by one for which data type and for what data, this error is getting thrown?
    Here is the description of the table "flyspray_projects" :
    Field                    Type               Null      Key          Default          Extra          
    project_id               int(3)                         PRI                         auto_increment
    project_title          varchar(100)                    
    theme_style               varchar(20)                              0     
    default_cat_owner     int(3)                                   0     
    intro_message          longtext                    
    project_is_active     int(1)                                   0     
    visible_columns          varchar(255)                    
    others_view               int(1)                                   0     
    anon_open               int(1)                                   0     
    notify_email          longtext                    
    notify_jabber          longtext                    
    notify_reply          text               YES               
    notify_types          varchar(100)                         0     
    feed_img_url          text               YES               
    feed_description     text               YES               
    notify_subject          varchar(100)                    
    lang_code               varchar(10)                              en     
    comment_closed          int(1)                                   0     
    auto_assign               int(1)                                   0     
    last_updated          int(11)                                   0     
    default_task          text               YES               
    default_entry          varchar(8)                              index     
    In my DataObject, I try with only ONE field.
    1) With "project_id", which is a number
    2) With "project_title" which is a varchar
    The result was the same Error Message :
    Logging Writeline(single parameter) Exception: java.lang.IllegalArgumentException: can't parse argument number - Exception occurred in method count(oracle.bam.adc.common.Modifier@33888bf4 DatasetID="_MysqlTestStringSeulement" Distinct=false AllFields=false Fields={} RecordFieldInfo=[] LookupInfo={} Ordering=[] Groupings={oracle.bam.adc.common.Groupings@366f70e Groups=[oracle.bam.adc.common.Group@366f71a FieldID="null" GroupRefID=null GroupRecordFieldInfo=[] GroupFields=[]]} Expression={null} GroupFilter={null} MaxRows=-1 TopN=-1 WithTies=false CollapseAggregates=false,true)
    Exception: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Erreur de syntaxe près de '"flyspray_projects"' à la ligne 1
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:930)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2864)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1567)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1659)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:3118)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1143)
    at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1256)
    at oracle.bam.adc.common.externaldatasources.JDBC.getDataReader(JDBC.java:335)
    at oracle.bam.adc.kernel.datasets.ExternalStorageEngine.getDataReader(ExternalStorageEngine.java:76)
    at oracle.bam.adc.kernel.datasets.Dataset.count(Dataset.java:4019)
    at oracle.bam.adc.kernel.server.DataStoreServer.count(DataStoreServer.java:886)
    at oracle.bam.adc.ejb.BamAdcServerBean.count(BamAdcServerBean.java:621)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at com.bea.core.repackaged.springframework.jee.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:104)
    at oracle.bam.adc.ejb.BamAdcServerBean.interceptor(BamAdcServerBean.java:263)
    at sun.reflect.GeneratedMethodAccessor356.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    at com.bea.core.repackaged.springframework.jee.intercept.JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:69)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.jee.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:104)
    at oracle.security.jps.wls.JpsWlsEjbInterceptor$1.run(JpsWlsEjbInterceptor.java:88)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    at oracle.security.jps.wls.util.JpsWlsUtil.runJaasMode(JpsWlsUtil.java:146)
    at oracle.security.jps.wls.JpsWlsEjbInterceptor.intercept(JpsWlsEjbInterceptor.java:106)
    at oracle.security.jps.ee.ejb.JpsInterceptor.intercept(JpsInterceptor.java:106)
    at sun.reflect.GeneratedMethodAccessor355.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    at com.bea.core.repackaged.springframework.jee.intercept.JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:69)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
    at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
    at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy197.count(Unknown Source)
    at oracle.bam.adc.ejb.BamAdcServerBean_wf34ei_BamAdcServerRemoteImpl.count(BamAdcServerBean_wf34ei_BamAdcServerRemoteImpl.java:1205)
    at oracle.bam.adc.api.client.BamAdcClient.count(BamAdcClient.java:641)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at oracle.bam.common.remoting.BamEjbProxy.invoke(BamEjbProxy.java:209)
    at $Proxy196.count(Unknown Source)
    at oracle.bam.adc.api.datasets.Dataset.count(Dataset.java:1421)
    at oracle.bam.web.architect.DataObjectsView.general(DataObjectsView.java:182)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at oracle.bam.web.shared.WebPage.invokeWebMethod(WebPage.java:496)
    at oracle.bam.web.shared.WebPage.processRequest(WebPage.java:430)
    at oracle.bam.web.shared.WebPage.processRequest(WebPage.java:312)
    at jsp_servlet._6512._architect.__default._jspService(__default.java:71)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.wls.JpsWlsFilter$1.run(JpsWlsFilter.java:96)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    at oracle.security.jps.wls.util.JpsWlsUtil.runJaasMode(JpsWlsUtil.java:146)
    at oracle.security.jps.wls.JpsWlsFilter.doFilter(JpsWlsFilter.java:140)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.bam.web.cache.ClientSideCache.doFilter(ClientSideCache.java:93)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.bam.web.filters.GZIPFilter.doFilter(GZIPFilter.java:86)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.bam.web.filters.ValidateBrowserSession.doFilter(ValidateBrowserSession.java:213)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.bam.web.redirect.Redirect.doFilter(Redirect.java:79)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.bam.web.filters.ValidateBrowserSupport.doFilter(ValidateBrowserSupport.java:133)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.bam.web.filters.CharsetFixupFilter.doFilter(CharsetFixupFilter.java:65)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:202)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3588)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2200)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2106)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1428)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Jan 8, 2010 10:44:45 AM oracle.bam.common.logging.Log writeLine
    SEVERE: ActiveDataCache: Exception occurred in method openViewset(_MysqlTestStringSeulement,0)
    Exception: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Erreur de syntaxe près de "flyspray_projects" à la ligne 1
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:930)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2864)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1567)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1659)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:3118)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1143)
    at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1256)
    at oracle.bam.adc.common.externaldatasources.JDBC.getDataReader(JDBC.java:335)
    at oracle.bam.adc.kernel.datasets.ExternalStorageEngine.getDataReader(ExternalStorageEngine.java:76)
    at oracle.bam.adc.kernel.viewsets.utilities.externaldata.DataImporter.executeQuery(DataImporter.java:95)
    at oracle.bam.adc.kernel.viewsets.utilities.externaldata.ExternalDataManager.importExternalData(ExternalDataManager.java:233)
    at oracle.bam.adc.kernel.viewsets.utilities.externaldata.ExternalDataManager.importExternalFactData(ExternalDataManager.java:156)
    at oracle.bam.adc.kernel.viewsets.utilities.externaldata.ExternalDataManager.getExternalData(ExternalDataManager.java:108)
    at oracle.bam.adc.kernel.viewsets.Viewset.loadData(Viewset.java:259)
    at oracle.bam.adc.kernel.viewsets.ViewsetBase.initialize(ViewsetBase.java:169)
    at oracle.bam.adc.kernel.viewsets.Viewset.initialize(Viewset.java:220)
    at oracle.bam.adc.kernel.viewsets.ViewsetBase.open(ViewsetBase.java:152)
    at oracle.bam.adc.kernel.viewsets.ViewsetManager.initViewset(ViewsetManager.java:368)
    at oracle.bam.adc.kernel.viewsets.ViewsetManager.openViewset(ViewsetManager.java:361)
    at oracle.bam.adc.kernel.server.DataStoreServer.openViewset(DataStoreServer.java:1072)
    at oracle.bam.adc.ejb.BamAdcServerBean.openViewset(BamAdcServerBean.java:894)
    at sun.reflect.GeneratedMethodAccessor360.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at com.bea.core.repackaged.springframework.jee.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:104)
    at oracle.bam.adc.ejb.BamAdcServerBean.interceptor(BamAdcServerBean.java:263)
    at sun.reflect.GeneratedMethodAccessor356.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    at com.bea.core.repackaged.springframework.jee.intercept.JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:69)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.jee.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:104)
    at oracle.security.jps.wls.JpsWlsEjbInterceptor$1.run(JpsWlsEjbInterceptor.java:88)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    at oracle.security.jps.wls.util.JpsWlsUtil.runJaasMode(JpsWlsUtil.java:146)
    at oracle.security.jps.wls.JpsWlsEjbInterceptor.intercept(JpsWlsEjbInterceptor.java:106)
    at oracle.security.jps.ee.ejb.JpsInterceptor.intercept(JpsInterceptor.java:106)
    at sun.reflect.GeneratedMethodAccessor355.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    at com.bea.core.repackaged.springframework.jee.intercept.JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:69)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
    at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
    at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy197.openViewset(Unknown Source)
    at oracle.bam.adc.ejb.BamAdcServerBean_wf34ei_BamAdcServerRemoteImpl.openViewset(BamAdcServerBean_wf34ei_BamAdcServerRemoteImpl.java:3231)
    at oracle.bam.adc.api.client.BamAdcClient.openViewset(BamAdcClient.java:930)
    at sun.reflect.GeneratedMethodAccessor359.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at oracle.bam.common.remoting.BamEjbProxy.invoke(BamEjbProxy.java:209)
    at $Proxy196.openViewset(Unknown Source)
    at oracle.bam.adc.api.viewsets.Viewset.open(Viewset.java:75)
    at oracle.bam.web.architect.DataObjectsContents.internalContentsByRowID(DataObjectsContents.java:582)
    at oracle.bam.web.architect.DataObjectsContents.contentsByRowID(DataObjectsContents.java:463)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at oracle.bam.web.shared.WebPage.invokeWebMethod(WebPage.java:496)
    at oracle.bam.web.shared.WebPage.processRequest(WebPage.java:430)
    at oracle.bam.web.shared.WebPage.processRequest(WebPage.java:312)
    at jsp_servlet._6512._architect.__default._jspService(__default.java:71)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.wls.JpsWlsFilter$1.run(JpsWlsFilter.java:96)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    at oracle.security.jps.wls.util.JpsWlsUtil.runJaasMode(JpsWlsUtil.java:146)
    at oracle.security.jps.wls.JpsWlsFilter.doFilter(JpsWlsFilter.java:140)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.bam.web.cache.ClientSideCache.doFilter(ClientSideCache.java:93)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.bam.web.filters.GZIPFilter.doFilter(GZIPFilter.java:86)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.bam.web.filters.ValidateBrowserSession.doFilter(ValidateBrowserSession.java:213)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.bam.web.redirect.Redirect.doFilter(Redirect.java:79)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.bam.web.filters.ValidateBrowserSupport.doFilter(ValidateBrowserSupport.java:133)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.bam.web.filters.CharsetFixupFilter.doFilter(CharsetFixupFilter.java:65)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:202)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3588)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2200)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2106)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1428)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

  • SQL being generated improperly - JDBC bc - poll operation

    I have a bpel process that is kicked off by a JDBC binding component's "poll" operation. I have the PollingPostProcessing value set to MarkColumn. I've set the MarkColumnName and MarkColumnValue parameters (see below). The column I'm marking is defined as:
    TINYINT(4), not null, with a default value of 0.
    I'm using MySQL v5
    My issue is that the SQL generated by JBI is incorrect, it's missing spaces: select * from .mbmessage where monitored != *1ormonitoredis* NULL
    The Error:
    Received in-only message.
    Executing sql . select * from .mbmessage
    Unexpected exception Occured while processing the MEP.
    javax.jbi.messaging.MessagingException: Error occured while executing sql.select * from .mbmessage where monitored != 1ormonitoredis NULL
            at com.sun.jbi.jdbcbc.InboundMessageProcessor.executeInboundSQLSelect(InboundMessageProcessor.java:484)
            at com.sun.jbi.jdbcbc.InboundMessageProcessor.processInOnly(InboundMessageProcessor.java:388)
            at com.sun.jbi.jdbcbc.InboundMessageProcessor.execute(InboundMessageProcessor.java:308)
            at com.sun.jbi.jdbcbc.InboundMessageProcessor.run(InboundMessageProcessor.java:231)
            at java.lang.Thread.run(Thread.java:619)
    Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: 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 'NULL' at line 1
            at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
            at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
            at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
            at com.mysql.jdbc.Connection.execSQL(Connection.java:3256)
            at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1313)
            at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1448)
            at com.sun.jbi.jdbcbc.InboundMessageProcessor.executeInboundSQLSelect(InboundMessageProcessor.java:480)
            ... 4 moreHere is a snippet from my JDBC binding component.
    <jdbc:input xmlns:jdbc="http://schemas.sun.com/jbi/wsdl-extensions/jdbc/" MarkColumnName="monitored" MarkColumnValue="1" MoveRowToTableName="" PKName="messageId" PollMilliSeconds="5000" PollingPostProcessing="MarkColumn" TableName=".mbmessage" Transaction="NOTransaction" numberOfRecords="" operationType="poll" paramOrder="" sql="...."/>Has anyone else come across this situation? I'm hoping that it's something easy I'm overlooking.
    Thanks in advance,
    -sellerjd

    Does anyone have the JDBC binding component's "poll" operation working correctly, using the "MarkColumn" option for the PollingPostProcess attribute? If so, could you share your experiences in setting it up? Does the "marked column" in the database need to be a specific type or have certain rules?
    Any info would be very much appreciated.

  • Casting a JDBC resultSet to VO RowSet?

    Is it possible to somehow transform a plain vanilla jdbc ResultSet to a VO RowSet? (Of course without iterating!) Either by passing the entire object (with all rows intact) or by casting?
    Thanks
    -Nat
    PS. Rob, you know why I want to do this, right&lt;g&gt;?

    We use JDBC to access the database internally. BC4J automates a best-practice use of JDBC PreparedStatements and ResultSet's for you without your having to worry about remembering the low-level details.
    Our generic JDBC-interaction code worries about consistently applying the best-practice and highest-performance JDBC techniques for you. When we discover a further improvement and implement it, all of your view objects immediately benefit in the next release.
    We had a team in Oracle Applications who claimed they could read large amounts of data faster with hand-coded JDBC than with BC4J. They weren't using BC4J in the optimal way and I illustrated by modifying their benchmark how to make BC4J be faster than hand-coded raw use of JDBC.
    Their benchmark wasn't really comparing apples to apples, so I made sure they were comparing roughly equivalent amounts of work before we could conclude what was better.

Maybe you are looking for

  • ITunes 64-Bit stopped working on Windows 7

    After having my Laptop stolen I got a new HP with Windows 7 64-Bit. Installed iTunes 64-Bit and for the first 5 days it worked. Then iTunes wouldn't launch. Un-installed and used RegEdit to remove all traces, then re-installed to no avail. I'm in the

  • MSI K8N Neo Platanium Mobo Vista Drivers HELP

    I Installed Vista On My PC But i dont know what drivers to install for my Motherboard as the drivers are for XP...Is there any vista drivers for my Motherboard also do the USB 2.0 Drivers for this MoBo on the MSI site work on Vista.... thanks

  • Opened project from November, interpret footage settings gone

    I just opened a project from November. All the clips that were shot at 59.94fps then interpreted to 23.976fps have lost the setting. Everything in the bin that was shot at 59.94fps is back to its original speed. The result is in the sequence, those c

  • IMessage photo messages not working?

    I have an iPhone 4 on iOs 6.1.2 through Net10, for about the past two weeks I haven't been able to send photo messages throught iMessage, well they say they were "Delivered" but my friend in the uk hasn't received them (it worked previously and they

  • Why is CBS Sports not loading properly

    Ever since last night when I access cbsports.com all that appears is a jumbled mess. There are a lot of blue question marks, content and photos missing, etc. It looks as if it was not formatted properly. Also, it doesn't matter what browser I use (Sa