Java试题
【题目】在普通应用程序中用JDBC做一个数据库事务,程序片断如下请填空:
String driver=“com.informix.jdbc.ifxDriver”;
String url=
“jdbc:informix-sqli://11.6.6.11:9002/test:INFORMIXSERVER=ifx”;
String user=“informix”;
String password=“informic”;
String sql=“update TESTDB set status=‘2’ ”
1
Connection conn= 2
Statement stment=conn.createsStatement();
Try
{
3 ;
stment .executeUpdate(sql);
4
5
6
}
catch(SQLException e)
{
try
{
7
8
9
}
catch(SQLException el)
{ //do nothing}
}