Solve | The problem
The way to solve the problem is:
Change the bufferwriter to printwrite on it, wow, what's going on?? Did Bufferwriter and Bufferreader have a conflict? Bufferwriter cannot flush () and close () when Bufferreader is ReadLine ()? Weird
The program is no problem, my data synchronization platform can also operate.
public class Serverthread extends Thread {private int port; public serverthread (int port) {this.port = port; }
Private Boolean stop = false;
public void Run () {try {serversocket server = new ServerSocket (port); while (!stop) {Socket client = server.accept (); BufferedReader read = new BufferedReader (New InputStreamReader (Client.getinputstream ())); PrintWriter StreamWriter = new PrintWriter (Client.getoutputstream ());//The key is here System.out.println ("Send welcome information");
Streamwriter.println ("Welcome xx"); StreamWriter.Flush ()//If Use bufferwriter this sentence does not work, also cannot send out, therefore the client also cannot receive
public static void Main (string[] args) {Thread server = new Serverthread (10020); Server.start (); }
public Boolean isstop () {return stop; }
public void Setstop (Boolean stop) {this.stop = stop; }}
Now also encountered a problem is to use Java JDBC in the database generation trigger, unexpectedly will report syntax error, but still in the database generated trigger, and manual with Pl/sql tools to run a good, this is how to return, strange ~
Specifically, this is true:
Stmt.executeupdate (String triggersql); Trigger is generated in the database schema, but the error state (not the Disable state) then runs this pl/sql with the trigger tool, and there's no problem.
According to the information of the error, we find that it seems that the JDBC syntax does not support more complex SQL, so how do we generate trigger with the program??
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.