本文共 1734 字,大约阅读时间需要 5 分钟。
- import java.io.BufferedReader;
- import java.io.FileInputStream;
- import java.io.InputStreamReader;
-
-
-
-
-
- public class BatchGenTriger {
-
- public static void main(String[] args) {
- String filePath = "C:\\Users\\jade\\Desktop\\trigers.txt";
- try {
- try (BufferedReader bufReader = new BufferedReader(new InputStreamReader(new FileInputStream(filePath), "UTF-8")))
- {
- String temp = null;
- while ((temp = bufReader.readLine()) != null) {
- System.out.println("CREATE TRIGGER \"tri_" + temp + "\" BEFORE INSERT OR UPDATE OR DELETE ON " + temp + " FOR EACH ROW EXECUTE PROCEDURE change_trigger();");
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- CREATE SCHEMA logging;
- CREATE TABLE logging.user_history (
- id serial,
- tstamp timestamp DEFAULT now(),
- schemaname text,
- tabname text,
- operation text,
- who text DEFAULT current_user,
- new_val json,
- old_val json
- );
转载地址:http://nmjhl.baihongyu.com/