The question of last Java Socket has been resolved, this time about Trigger problem

xiaoxiao2021-03-06  15

The method of solving the problem is turnedynapy to change the bufferwriter to PrintWrite, wow, what is going on? ? Is bufferWriter and BufferReader conflict? BufferWriter can't flush () and close () when Readline () in BufferReader. The weird program is changed to this, and I can work in my data synchronization platform.

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 ()); // this is a key System.out .println ("Send Welcome Information"); streamwriter.println ("Welcome XX"); streamwriter.flush (); // If you use bufferwriter, you can't afford it, so you can't get it. To string linestr = read.readline (); if ("Start" .Equals (linestr)) {system.out.println ("Start Accept Data!"); While (True) {linestr = read.readline (); if ("End" .equals (LINESTR)) { Break;} else {system.out.println ("data is" linestr);}}} streamwriter.close (); read.close (); client.close ();}} catch (ooException ex) {EX. printStackTrace ();}} 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 I have encountered a problem to generate Trigger with Java's JDBC, which will report the syntax, but still generate TRIGGER in the database, and the manual use of PL / SQL tools will run, how is this? Waiting, blame ~ The specific is this: stmt.executeUpdate (String Triggersql);

Trigger is generated in the database schema, but the error status (not the Disable status)

Then use the PL / SQL tool to run this Trigger, there is no problem.

According to the error message, we found that the syntax of JDBC does not support more complex SQL, then how do we generate TRIGGERs in programs? ?

转载请注明原文地址:https://www.9cbs.com/read-48613.html

New Post(0)