📄 attachmentpersistent.java
字号:
/*
* attachmentPersistent.java
* Generated using xgen and texen from beanpersistent.vm
* Wed Mar 03 13:44:52 CST 2004
*/
package com.sure.oa.attachment;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.Statement;
import java.sql.SQLException;
/**
* 将正文或附件存入数据库
* @author datonghuiren@sohu.com
*/
public class attachmentPersistent extends attachmentPersistentBase {
public attachmentPersistent(attachment bean) { super(bean); }
public attachmentPersistent(attachment bean, boolean recordExists) { super(bean, recordExists); }
public static void updateAttachment(Connection conn, int docId,String where,String newpath) throws SQLException {
String sql = "Update Attachment Set docId=? ,site=?";
sql=sql+" "+where;
//System.out.println(sql);
PreparedStatement ps = conn.prepareStatement(sql);
ps.setInt(1, docId);
ps.setString(2, newpath);
ps.executeUpdate();
ps.close();
}
public static void updateSeal(Connection cn, String where) throws SQLException{
String sql = "Update Attachment set status=11 " + where;
Statement st = cn.createStatement();
st.executeUpdate(sql);
st.close();
}
/**
* Update an existing record
* 修改盖章后修改过公文正文的公文本身的status=0,盖章前正文
* (including the primary key)
* 雷敏
* 2002-08-13
*/
public static void updateAttachmentStatus(Connection conn,String where) throws SQLException{
Statement stmt = conn.createStatement();
String sql = "UPDATE attachment SET status=1 " + where;
stmt.execute(sql);
stmt.close();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -