aspose file tools*
The moose likes JDBC and the fly likes how to write data into access database? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "how to write data into access database?" Watch "how to write data into access database?" New topic
Author

how to write data into access database?

ramesh kumar
Ranch Hand

Joined: Nov 16, 2000
Posts: 32
hi all,
One of my course study needs me to update data to a database.
I am using MS.access and i am not able to insert or append any data into the data base. I am able to get connected, draw and process datas from ms-access. Pls friends, let me know the method to do it.
with regards
Ramesh.
------------------
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
statement.executeUpdate(String sql)
If you are having problems maybe you can show the code snippet.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
ramesh kumar
Ranch Hand

Joined: Nov 16, 2000
Posts: 32
Hi, here given below is my coding which works fine.
In this coding i want to update database with a new
userID and password. That is where my problem starts.
help me to do it.
thanks a lot.
// yahoo password checking


[This message has been edited by maha anna (edited December 08, 2000).]
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
Hi Ramesh,
In your code I couldn't get the need for 'updating the database'. What you are doind is just query the database compare the user's login and password and take action accordingly.
.executeQuery is for selecting records
.executeUpdate is for making changes to the database records.
Can you tell us the reason , you want to update the database?
regds
maha anna
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Why don't you show us the code you are using that isn't working.
ramesh kumar
Ranch Hand

Joined: Nov 16, 2000
Posts: 32
Hi MahaLakshmi, Nice to meet u.
In my code, I want to update the database with the user name
and password if it already doesn't exist.
It is just like creating a new account in yahoo if the user dont
have any ID?.
I hope now u understand my needs.
Thanks
with regards
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
So what's the problem? Is it not working or is it that you don't know how to do it? If it isn't working, then show us the code you are using.
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
In your else { } block of code you have to do the insert. Modify this code to your variables and table col names.

[This message has been edited by maha anna (edited December 08, 2000).]
ramesh kumar
Ranch Hand

Joined: Nov 16, 2000
Posts: 32
Thanks maha,
I'll try your code now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to write data into access database?