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 jdbc java insert program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "jdbc java insert program" Watch "jdbc java insert program" New topic

jdbc java insert program

dedeepya pilla

Joined: Jan 11, 2013
Posts: 3
Hi Team,
im doing one jdbc program in java for insertion into msacces database,code is running fine but the values are not reflecting in the database.
but im able to retrive the table data for same kind of program nd table.

output it is showing as:1rows updated

thanks in advnace
Kemal Sokolovic

Joined: Jun 19, 2010
Posts: 825

Please CarefullyChooseOneForum, this topic is more suitable for JDBC forum. Also I have added code tags this time; for future reference please read UseCodeTags (<- click); with proper indentation and code tags your code is easier and more pleasant for us to read, so you will most likely get your answer faster.

Welcome to the Ranch!

The quieter you are, the more you are able to hear.
Martin Vajsar

Joined: Aug 22, 2010
Posts: 3733

There could be several reasons. Perhaps you're looking into a different database from the one you're inserting into from Java (double check the ODBC definition). You might also be missing a commit, though that doesn't look likely if this is the whole of your problematic code, since JDBC is in autocommit mode by default. (Missing commit is a source of confusion in a lot of cases, though, so I'm mentioning it here nevertheless.)
dedeepya pilla

Joined: Jan 11, 2013
Posts: 3
yes thanks it working now
i forgot to close the connection
now it is working
I agree. Here's the link:
subject: jdbc java insert program
It's not a secret anymore!