20171012 New Patch Package program, the program organizes all the keywords and reserved words, support field a = "Field B" with field a = Field B, and do code refactoring. Keyword-specific testing of patch packs to verify keyword reserved words as libraries, tables, views, fields, dictionaries, etc.
Package Com.io.test;import Java.io.bufferedreader;import Java.io.bufferedwriter;import java.io.FileInputStream; Import Java.io.filenotfoundexception;import Java.io.fileoutputstream;import Java.io.inputstreamreader;import Java.io.OutputStreamWriter;PublicClassConstTest01 {PublicStaticvoidMain (string[] args) throws Exception {//TODO auto-generated Method Stub String path01 ="C:\\tmp\\const.txt"; String path02 ="C:\\tmp\\ksql.txt"; FileInputStream FIS =NewFileInputStream (PATH01); InputStreamReader ISR =NewInputStreamReader (FIS); BufferedReader br =NewBufferedReader (ISR); FileOutputStream fos =NewFileOutputStream (PATH02); OutputStreamWriter OSR =NewOutputStreamWriter (FOS); BufferedWriter BW =NewBufferedWriter (OSR); String temp; String Temp01;while ((Temp=br.readline ())! =Null) {if (Temp.contains ("\"")) {string[] arr = Temp.split ("\""); TEMP01 = arr[1]; Bw.write ("--<drop>"); Bw.newline (); temp ="drop table"+temp01+"\ngo"; Bw.write (temp); Bw.newline (); Bw.write ("--<create>"); Bw.newline (); temp ="CREATE TABLE"+temp01+"\npath \ ' c:\\tmp\\table\\"+temp01+"\ ' \nat temp \ n ("+temp01+"Integer (8) normal,test Integer (8) NORMAL) \ngo";//SYSTEM.OUT.PRINTLN (temp);Bw.write (temp); Bw.newline (); Bw.write ("--<insert>"); Bw.newline (); temp ="INSERT into"+temp01+"("+temp01+", test) \nvalues (0,12345678) \ngo"; Bw.write (temp); Bw.newline (); Bw.write ("--<select recordset=1-*>"); Bw.newline (); temp ="SELECT * FROM"+temp01+"\ngo"; Bw.write (temp); Bw.newline (); Bw.write ("--<update>"); Bw.newline (); temp ="Update"+temp01+"Set"+temp01+"= Test\ngo"; Bw.write (temp); Bw.newline (); Bw.write ("--<select recordset=1-*>"); Bw.newline (); temp ="SELECT * FROM"+temp01+"\ngo"; Bw.write (temp); Bw.newline (); Bw.write ("--<update>"); Bw.newline (); temp ="Update"+temp01+"Set"+temp01+"= \ "Test\" \ngo"; Bw.write (temp); Bw.newline (); Bw.write ("--<select recordset=1-*>"); Bw.newline (); temp ="SELECT * FROM"+temp01+"\ngo"; Bw.write (temp); Bw.newline (); Bw.write ("--<drop>"); Bw.newline (); temp ="drop table"+temp01+"\ngo\n"; Bw.write (temp); Bw.newline (); Bw.write ("--<create>"); Bw.newline (); temp ="CREATE VIEW"+temp01+"As SELECT * from Sys_log_1\ngo"; Bw.write (temp); Bw.newline (); Bw.write ("--<select recordset=1-*>"); Bw.newline (); temp ="SELECT * FROM"+temp01+"\ngo"; Bw.write (temp); Bw.newline (); Bw.write ("--<drop>"); Bw.newline (); temp ="DROP VIEW"+temp01+"\ngo\n"; Bw.write (temp); Bw.newline (); Bw.write ("--<create>"); Bw.newline (); temp ="CREATE DATABASE"+temp01+"\ngo"; Bw.write (temp); Bw.newline (); Bw.write ("--<drop>"); Bw.newline (); temp ="DROP DATABASE"+temp01+"\ngo\n"; Bw.write (temp); Bw.newline (); Bw.write ("--<drop>"); Bw.newline (); temp ="Drop Sortdict"+temp01+"\ngo"; Bw.write (temp); Bw.newline (); Bw.write ("--<create>"); Bw.newline (); temp ="CREATE sortdict"+temp01+"\npath \ ' c:\\\\tmp\\\\table\\\\ ' \naliasname \ ""+temp01+"\ "\norder by Spell\nmaxwordlen 30\nsortvaluenum 1\ngo"; Bw.write (temp); Bw.newline (); Bw.write ("--<drop>"); Bw.newline (); temp ="Drop Sortdict"+temp01+"\ngo\n"; bw.write (temp); Bw.newline ();} Else if (Temp.contains ("//")) {Temp=temp.trim (). Replace ("//", "--- ---"); System. out. println (temp); Bw.write (temp); Bw.newline ();} // Bw.write (temp); Bw.newline (); } bw.flush (); Bw.close (); }}
Java Batch Generation use case Script-use case script generation for reserved word keywords