File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes inserting values to the database from table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "inserting values to the database from table" Watch "inserting values to the database from table" New topic

inserting values to the database from table

Amit kumar

Joined: May 09, 2003
Posts: 16
i have developed a web applet in java.
here i have created a table using swing package
[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

tell to guide
Abhilash Vasudevan

Joined: Mar 31, 2003
Posts: 19
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.
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
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!

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
I agree. Here's the link:
subject: inserting values to the database from table
It's not a secret anymore!