📄 notedaoimpl.java
字号:
package cn.zd ;
import zd.bbs.*;
//ע���¼ģ��
import java.sql.* ;
import java.util.* ;
public class NoteDAOImpl implements NoteDAO
{
public void insert(Note note) throws Exception
{
String sql = "INSERT INTO zu(username,password,sex,tag,qq,email,how,works,phone) VALUES(?,?,?,?,?,?,?,?,?)" ;
PreparedStatement pstmt = null ;
DataBaseConnection dbc = null ;
dbc = new DataBaseConnection() ;
try
{
if(note.invalidate()){
pstmt = dbc.getConnection().prepareStatement(sql) ;
pstmt.setBytes(1,note.getUsername().getBytes());
pstmt.setString(2, note.getPassword());
pstmt.setInt(3, note.getSex());
pstmt.setString(4,note.getTag());
pstmt.setString(5,note.getQq());
pstmt.setString(6, note.getEmail());
pstmt.setString(7, note.getHow());
pstmt.setString(8, note.getWorks());
pstmt.setString(9, note.getPhone());
pstmt.executeUpdate() ;
pstmt.close() ;
}
}
catch (Exception e)
{
// System.out.println(e) ;
throw new Exception("�����г��ִ��
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -