小编ale*_*lex的帖子

不推荐使用DataInputStream中的java [deprecation] readLine()?

我写了一个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)

java sql-server postgresql deprecated

2
推荐指数
1
解决办法
5615
查看次数

标签 统计

deprecated ×1

java ×1

postgresql ×1

sql-server ×1