📄 sclosesocket.java
字号:
import java.sql.*;
/**
*
* When user leave, set his/her state to offline and IP address to null.<p>
* 2005.8.27
* @version 0.1.2
* @author Daxin Tian
*
*/
public class ScloseSocket {
Connection con;
Statement sql;
/**
*
* @param name Who leave the server.
*/
ScloseSocket(String name)
{
try
{
//Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Class.forName("com.mysql.jdbc.Driver");
}
catch(ClassNotFoundException e)
{
}
try
{
//con=DriverManager.getConnection("jdbc:odbc:jidxdb","","");
con=DriverManager.getConnection("jdbc:mysql://localhost/jidx");
sql=con.createStatement();
sql.execute("update register set state=0, ips=null where username='"+name+"'");
con.close();
}
catch(SQLException e)
{
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -