How to print PreparedStatment object in console
807580Aug 20 2010 — edited Aug 21 2010Dear All
i am using PreparedStatment for inserting data into a table, in my local system it is working fine, but after deploying in JBoss(Server) it is throwing "invalid column type" error. In order to check i tried to print in the JBoss console but i am unable print in the console, kindly help me regarding this.
The code which i used is:
PreparedStatement stmtPrep = conn.prepareStatement(sql);
try {
stmtPrep.setObject(1, number);
stmtPrep.setObject(2, (String) passList.get("PlantCode"));
stmtPrep.setObject(2, (String) passList.get("PlantExt"));
stmtPrep.setObject(3, ls_per_ord_qty_ind);
stmtPrep.setObject(4, ls_price);
stmtPrep.setObject(5, (String) inList.get(4));
stmtPrep.setObject(6, (String) List.get("txtStoreLoc"));
stmtPrep.setObject(7, (String) List.get(1));
h = (String) List.get("Price");
float unit = Float.valueOf(h.trim()).floatValue();
stmtPrep.setFloat(8, unit);
System.out.println(">>>Query is>>>>>"+stmtPrep);
}
Can any one guide me how to print in JBoss console this stmtPrep and check all the values that i am passing r correct r not.
but it is throwing like this:
15:16:30,686 INFO [STDOUT] >>>Query is>>>>>org.jboss.resource.adapter.jdbc.Wrap
pedPreparedStatement@1056bdd