我写了一个java服务器套接字,它可以连接postgresql并返回值,但是当我编译javac -deprecation SQLServer.java时为什么警告不起作用?它没有任何错误.我怎么解决它?
SQLServer.java:66: warning: [deprecation] readLine() in DataInputStream has been deprecated
query = in.readLine();
^
1 warning
Run Code Online (Sandbox Code Playgroud)
码:
import java.io.*;
import java.net.*;
import java.util.*;
import java.sql.*;
public class SQLServer extends Thread{
public static final int MYPORT = 6700;
ServerSocket listen_socket;
public SQLServer(){
try{
listen_socket = new ServerSocket (MYPORT);
}
catch(IOException e) {System.err.println(e);}
this.start();
}
public void run(){
try{
while(true)
{
Socket client_socket = listen_socket.accept();
SQLConnection c = new SQLConnection (client_socket);
}
}
catch(IOException e) {System.err.println(e);}
}
public static void …Run Code Online (Sandbox Code Playgroud)