How do I send data from a Jtable to my BD?

Asked

Viewed 625 times

1

I have a filled-in Jtable and need to store its data in a table in my database. How do I do that? I only know the reverse way (fill a table from the BD) am using Mysql

1 answer

1


You will need to do the following:

  1. Connect to the database using the appropriate credentials and the corresponding JDBC driver.
  2. For each Jtable row map the data to a record to be saved (it can be an Object Array where each Object receives the value of the Jtable cell)
  3. Record using Preparedstatment
  4. Close the connection to the database

That’s all

  • i want to do the opposite, grab the lines from my jtable and store in the database

  • post corrected !

Browser other questions tagged

You are not signed in. Login or sign up in order to post.