This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

inserting values to the database from table

 
Amit kumar
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have developed a web applet in java.
here i have created a table using swing package
through
[JTable table3 = new JTable(TestcolHeads);]
when user enters the data in the table.
i want to enter the data to database table.
can anyone help me to write a query to enter the values
 
Abhilash Vasudevan
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my opinion you may have to provide a button, clicking which you can run your database entry code.
It will be very easy to get the values into the database as you have methods like getValueAt(row,col) and getRowCount() etc. for the JTable class.
You may have to run a loop to collect all table entries and insert it to the database.
Regards
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ecomm Ksr,
Welcome to JavaRanch!
We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.
Thanks Pardner! Hope to see you 'round the Ranch!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic