import java.awt.*;
import java.net.*;
import java.applet.*;
import java.io.*;
public class TCPClient extends Applet
{
Socket sock;
DataInputStream in;
PrintStream out;
        public void init()
        {
           resize(300,400);
        }
        public void start()
        {
         try
         {
         sock=new Socket(getDocumentBase().getHost(),4700);
                    in=new DataInputStream(sock.getInputStream());

out=new PrintStream(sock.getOutputStream());

                }
                catch(IOException e)
                {
                 System.out.println(" Client error!");
                }       
                String tempstr="Select * from AI where AIMark='主变电压'";
         out.println(tempstr);
         try
         {
         String s=in.readLine();
         if(s!=null)
         System.out.println(s);
         else
         this.stop();
         }
         catch(IOException e)
         {
                }
        }
        public void stop()
        {
         try
         {
         sock.close();
         }
         catch(IOException e)
         {
                }
        }
}