logoffmodule.java
来自「文件共享虚拟社区,可以实现上传下载聊天等多种信息交互.」· Java 代码 · 共 52 行
JAVA
52 行
/*
* Created on 2005-9-8
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package fsc.server.modules;
/**
* @author chenhao
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
import fsc.models.*;
import java.util.Date;
import java.sql.*;
public class LogoffModule {
public static boolean logoff(String userToLogoff)
{
Connection conn=null;
try {
conn = DatabaseModule.getConnection();
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Statement st=null;
try
{
String sqlLogoff="update user_info set status=0 where username = "+userToLogoff;
st= conn.createStatement(); // = conn.prepareCall(sqlLogoff);
st.executeQuery(sqlLogoff);
st.close();
}catch(SQLException sqle)
{
sqle.printStackTrace();
}
st=null;
return true;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?