java - copying parameters from one PreparedStatement to another -


I create a new drawn position like this:

  was created Statement newPs = origPrepStatement.getConnection () .prepareStatement ("Expon" + sql);   

OrigPrepStatement is also prepared and includes parameters. I want to copy the parameters of origPrepStatement to the new POS. Is there any way to do this?

There is no easy solution; Find me uncomfortable solutions below

  classes apply the permiters invoice handler designed {map & lt; Integer, object & gt; Map = new hashmap & lt; & Gt; (); PAS prepared place; The statement statement prepared (place page prepared) {this.ps = ps; } The invocation of public goods (Object proxy, Method method, Object [] AGR) throws the throwable {if (method.getName (). StartWith ("set")}} return method.invoke (Proxy, Args); } Public Zero Copy Parameter (PS in Prepared Position) throws SQLException {{Map entry} for  E: map.entrySet ()) {ps.setObject (e.getKey () , E.Gast Value ()); }}} Public class T2 {public static zero main (string [] args throws an exception {the prepared statement ps1 = ... the generated location parameter ps1params = new statement statement parameter (p1); Ready placement ps1Proxy = (Prepared position) Proxy NAPProxy Instance (empty, new orbit [] (has been prepared), Newly created statement parameter (P1);); Ps1Proxy.setString (1, "test"); ... made PS2 = ... ps1params.copyParameters (ps2); }}    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

jsp - Google line chart x-axis shrinks on transition -

java - Reaching JTextField in a DocumentListener -