import java.io.*;
import java.net.*;
import java.sql.*;
import java.util.StringTokenizer;
public class DatabaseServer
{
public static void main(String args[])
{
ServerSocket server=null;
Server_thread thread;
Socket you=null;
while(true)
{
try
{
server=new ServerSocket(6666);
}
catch(IOException e1)
{
System.out.println("正在监听");
}
try
{
you=server.accept();
}
catch (IOException e)
{
}
if(you!=null)
{
new Server_thread(you).start();
}
else {continue;}
}
}
}
public class Server_thread extends Thread
{
Socket socket;
Connection con=null;
Statement stmt=null;
ResultSet rs;
DataOutputStream out=null;
DataInputStream in=null;
String s=null;
int number=0;
Server_thread(Socket t)
{
socket=t;
try {
in=new DataInputStream(socket.getInputStream());
out=new DataOutputStream(socket.getOutputStream());
}
catch (IOException e)
{
}
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(ClassNotFoundException e){}
try{
con=DriverManager.getConnection("jdbc:odbc:moon","","");
stmt=con.createStatement();
}
catch(SQLException ee) {}
}
慕虎7371278
不负相思意
呼唤远方