Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Martintin
Contributor III
Contributor III

Trouble inserting row in database

Hi guys,

 

I wanna insert rows without the tDBOutput because it is clearer with what i'm doing in parallel in my job.

I use a tJavaFlex to do so with the following code :

Initial code :

java.sql.Connection myConn = (java.sql.Connection)globalMap.get("conn_tDBConnection_2");
java.sql.Statement stmt = myConn.createStatement();

 

Principal code :

String query = "INSERT INTO DEVERYWARE.dbo.PEOPULSE_STDC(MATRICULE, MONTANT) VALUES('"+row4.matricule+"','"+row4.heure+"');";
stmt.executeUpdate(query);

 

I think that i'm doing the right thing but nothing appears in my table. 

Also, there is something strange, if i manually create a row in my table, the id is automatically given, which is normal.

So let's imagine it gets the id "500". If i execute my job, nothing appears in the table. 

But if i try to create a new row manually, it'll get the id "600", as if the rows that should have been inserted with my job had been in the table at a moment. 

 

It's probably not too much of a talend problem but more like a java/sql one, though I'd really appreciate some help.

Thanks in advance and sorry for the bad english (not my native language)

Martin

Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Are you committing?

View solution in original post

6 Replies
Anonymous
Not applicable

Are you committing?

Anonymous
Not applicable

Are you committing?

Martintin
Contributor III
Contributor III
Author

Thanks for the answer ! 

No, I thought there was no need to. 

I checked in several JDBC tutorial and they never mentionned any commit.

I'll see if it's the problem.

Martintin
Contributor III
Contributor III
Author

Thanks for the answer ! 

No, I thought there was no need to. 

I checked in several JDBC tutorial and they never mentionned any commit.

I'll see if it's the problem.

Martintin
Contributor III
Contributor III
Author

That's exactly what it was.

Thank you mate! 

Martintin
Contributor III
Contributor III
Author

That's exactly what it was.

Thank you mate!