Skip to content
Advertisement

Insert values into Database with Java

Hello I have a Jtable and a JFormattedTextField where I input the values to insert into the database. I used PreparedStatement but the output gives an error [SQL0418] Utilização de marcador de parâmetro ou NULL não válida.

I dont know what i did wrong. Its my first post if you have any questions about what im asking please tell me.

Advertisement

Answer

when you run your code, does anything run on the AS400?

When I troubleshoot these sorts of things I like to start at the basics. Here is an SQL procedure that sends a message to the QSYSOPR message queue:

use the STRSQL command prompt to create the procedure and then run it. Then DSPMSG QSYSOPR to see the message in QSYSOPR message queue.

Next, change your java code to “call qgpl/testHello” instead of the “insert into …” code. When you run the java code you should see the message in QSYSOPR.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement