Home > Back-end >  Excuse me each great god, Java execution affairs should be how to write? Small is looking for a few
Excuse me each great god, Java execution affairs should be how to write? Small is looking for a few

Time:11-03

If inscribe
 
Public Boolean JdbcUpdate (List SQLS ListConnection conn=null;
PreparedStatement STMT=null;
Boolean res=false;
Try {
Conn=getDataSource (.) getConnection ();
conn.setAutoCommit(false);
for (int i=0; I & lt; SQLS. The size (); I++) {
STMT=conn. PrepareStatement (SQLS. Get (I));
For (int j=0; j STMT. SetObject (j + 1, args. The get (I) [j]);
}
Int res1=0;
Res1=STMT. ExecuteUpdate ();
Res1=res1;
}
Conn.com MIT ();
Res=true;
}
The catch (Exception e) {... }
}

CodePudding user response:

The things you open

CodePudding user response:

reference 1st floor too food 12138 response:
do you things opened up

I think everyone say transaction is opened by default, write con. SetAutoCommit (false) can ah

CodePudding user response:

To see a lot of predecessors' experience is used with no parameters of SQL, cannot write so I don't know whether to take the parameters

CodePudding user response:

You call the transaction the opening method of
  • Related