Can we reuse one JDBC connection to run multiple SQL statements in an ITX Map?
The requirement is to first run a select query. Based on the results of this query and the source input, we need to insert several entries into a table. Once these inserts are completed, we must update the status in another table.
------------------------------
Akhi Singh
------------------------------
Original Message:
Sent: Mon August 25, 2025 04:11 PM
From: Rex Chan
Subject: JDBC adapter in ITX
This one works (the URL has changed to a different DB but the important thing is the SQL Stmt).
=PARSE(VALID(GET("JDBC","-URL jdbc:sqlserver://localhost:1433;databaseName=support;user=sa;password=SQLadmin1;encrypt=true;trustServerCertificate=true -QRY ""select Id,Value from dbo.ReportMetadata where Value like 'v%'"" -TV+ m4jdbc.mtr ",PACKAGE(InputParams:TargetTableKeys)),FAIL(LASTERRORMSG())))
------------------------------
Rex Chan
------------------------------
Original Message:
Sent: Mon August 25, 2025 08:43 AM
From: Santanu Baral
Subject: JDBC adapter in ITX
Thanks Rex
replacing single quote with double quote works for simple conditions but still not recognizing wild character like %.
Thanks for your help
------------------------------
Santanu Baral
Original Message:
Sent: Fri August 22, 2025 12:35 PM
From: Rex Chan
Subject: JDBC adapter in ITX
This is what I used for mysql database.
=PARSE(VALID(GET("JDBC","-URL jdbc:mysql://testserver:3306/testdb?verifyServerCertificate=false&useSSL=false&serverTimezone=UTC -USR testuser -PWD testpassword -QRY ""SELECT c1,c2,c3 FROM testtable WHERE c1=?"" -TV m4jdbc.mtr -QTY 1 -LSN 0 -AS 0",PACKAGE(InputParams:TargetTableKeys)),FAIL(LASTERRORMSG())))
I suggest not using % to start with and get the syntax working first. The URL probably is different from yours. Look for the trace file (m4jdbc.mtr) to see if it can help.
------------------------------
Rex Chan