From e488cf0f03589774285f0e860b8aab901f27ecad Mon Sep 17 00:00:00 2001 From: "Begerad, Stefan" Date: Tue, 10 May 2022 14:09:23 +0200 Subject: [PATCH] feat(postgres_java): adjust classes LctMsg... --- .../main/java/de/swingbe/postgres_java/LctMsgCreateTable.java | 4 ++-- .../src/main/java/de/swingbe/postgres_java/LctMsgInsert.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/postgres_java/src/main/java/de/swingbe/postgres_java/LctMsgCreateTable.java b/postgres_java/src/main/java/de/swingbe/postgres_java/LctMsgCreateTable.java index 122a0b5..0cb7c66 100644 --- a/postgres_java/src/main/java/de/swingbe/postgres_java/LctMsgCreateTable.java +++ b/postgres_java/src/main/java/de/swingbe/postgres_java/LctMsgCreateTable.java @@ -27,8 +27,8 @@ public class LctMsgCreateTable { //type: 0:echt,1:frei,2:wird benoetigt,3:virtuell //create a new table called friends and insert five rows into it - st.addBatch("DROP TABLE IF EXISTS lct_msg_x"); - st.addBatch("CREATE TABLE lct_msg_x(" + "bs_id bigserial PRIMARY KEY NOT NULL" + ",vc_trip VARCHAR(20) NOT NULL" + ",vc_route VARCHAR(20)" + ",vc_tenant VARCHAR(20)" + ",vc_date VARCHAR(20) NOT NULL" + ",vc_time VARCHAR(20) NOT NULL" + ",vc_lat VARCHAR(20) NOT NULL" + ",vc_lng VARCHAR(20) NOT NULL" + ")"); + st.addBatch("DROP TABLE IF EXISTS lct_msg_y"); + st.addBatch("CREATE TABLE lct_msg_y(" + "bs_id bigserial PRIMARY KEY NOT NULL" + ",vc_trip VARCHAR(20) NOT NULL" + ",vc_route VARCHAR(20)" + ",vc_tenant VARCHAR(20)" + ",vc_date VARCHAR(20) NOT NULL" + ",vc_time VARCHAR(20) NOT NULL" + ",vc_lat VARCHAR(20) NOT NULL" + ",vc_lon VARCHAR(20) NOT NULL" + ")"); //method returns an array of committed changes int[] counts = st.executeBatch(); diff --git a/postgres_java/src/main/java/de/swingbe/postgres_java/LctMsgInsert.java b/postgres_java/src/main/java/de/swingbe/postgres_java/LctMsgInsert.java index 125e3e7..93621c3 100644 --- a/postgres_java/src/main/java/de/swingbe/postgres_java/LctMsgInsert.java +++ b/postgres_java/src/main/java/de/swingbe/postgres_java/LctMsgInsert.java @@ -26,7 +26,7 @@ public class LctMsgInsert { con.setAutoCommit(false); //create a new table called friends and insert five rows into it - st.addBatch("INSERT INTO lct_msg_x(" + "vc_trip" + ",vc_route" + ",vc_tenant" + ",vc_date" + ",vc_time" + ",vc_lat" + ",vc_lng" + ") VALUES (" + "'4457006'," + "'4457'," + "'EDZ/247'," + "'2022-05-10'," + "'13:34:05,824'," + "'74635669'," + "'534651826')"); + st.addBatch("INSERT INTO lct_msg_y(" + "vc_trip" + ",vc_date" + ",vc_time" + ",vc_lat" + ",vc_lon" + ") VALUES (" + "'4457006'," + "'2022-05-10'," + "'13:34:05,824'," + "'74635669'," + "'534651826')"); //method returns an array of committed changes int[] counts = st.executeBatch();