java.sql.Statement st=conn.createStatement();
//st.setString(1,p.getPubid());
java.sql.ResultSet rs=st.executeQuery(sql);
if(rs.next()) throw new BusinessException("出版
社编号已经被占用");
rs.close();
st.close();
sql="select * from BeanPublisher where
publisherName='"+p.getPublisherName()+"'";
st=conn.createStatement();
// st.setString(1, p.getPublisherName());
rs=st.executeQuery(sql);
if(rs.next()) throw new BusinessException("出版
社名称已经存在");
rs.close();
st.close();
sql="insert into
BeanPublisher(pubid,publisherName,address)
values('"+p.getPubid()+"','"+p.getPublisherName()+"','"
+p.getAddress()+"')";
st=conn.createStatement();
//st.setString(1, p.getPubid());
评论0
最新资源