This Domain(Admin5.com) is for Sale:

Velocity 的应用示例

时间:2007-10-22  来源:不详  作者:林子

}

catch (Exception e)

{

//Utilities.debugPrintln(e.getMessage());

e.printStackTrace();

}

return null;

}

public static void excuteDbUpdate(String sql, Object[] parameters)

{

Connection con = Utilities.getDatabaseConnection();

excuteDbUpdate(con, sql, parameters);

closeDbConnection(con);

}

public static void excuteDbUpdate(Connection con, String sql,Object[] parameters)

{

Exception err = null;

try

{

java.sql.PreparedStatement ps = con.prepareStatement(sql);

for (int i = 0;

i <

parameters.length;

i )

{

processParameter(ps, i 1, parameters[i]);

}

ps.execute();

}

catch (Exception e)

{

err = e;

//Utilities.debugPrintln(err.getMessage());

e.printStackTrace();

}

}

private static void processParameter(java.sql.PreparedStatement ps, int index, Object parameter)

{

try

{

if (parameter instanceof String)

看完这篇,您有何感觉呢?

文章评论

共有位Admini5网友发表了评论 查看完整内容

24小时热门信息