📄 firstleveltitledboperation.java~62~
字号:
package DB;
import bean.ConnectionBean;
import bean.FirstLevelTitle;
import bean.SecondLevelTitle;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Connection;
import java.sql.SQLException;
public class FirstLevelTitleDbOperation {
public FirstLevelTitleDbOperation() {
}
public int instersecond(FirstLevelTitle fTitle) throws SQLException {
int host = 0;
Connection con = null;
ResultSet ret = null;
PreparedStatement stmt = null;
try
{
ConnectionBean dbcon = ConnectionBean.newInstance();
con = dbcon.getConnDB();
stmt = con.prepareStatement("insert into FirstLevelTitle(TitleName,FilePath,Creater,ParentTitle) values(?,?,?,?)");
stmt.setString(1, fTitle.getTitleName());
stmt.setString(2, fTitle.getCreater());
host = stmt.executeUpdate();
}
catch(Exception e)
{
e.printStackTrace();
}
finally
{
con.close();
stmt.close();
}
return host;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -