use of ngse.org.DBUtil in project MSEC by Tencent.
the class SharedobjectUpload method insertTable.
private String insertTable(String firstName, String secondName, String tagName, String memo) {
DBUtil util = new DBUtil();
if (util.getConnection() == null) {
return "DB connect failed.";
}
String sql;
List<Object> params = new ArrayList<Object>();
sql = "insert into t_sharedobject_tag(first_level_service_name, " + "second_level_service_name,tag_name, memo) values(?,?,?,?)";
params.add(firstName);
params.add(secondName);
params.add(tagName);
params.add(memo);
try {
int addNum = util.updateByPreparedStatement(sql, params);
if (addNum >= 0) {
return "success";
}
return "insert failed";
} catch (SQLException e) {
return "insert failed";
} finally {
util.releaseConn();
}
}
Aggregations