JDBC: ADD Data

Hey all,
I can setup a JDBC connection, and retrieve data (using "SELECT ..."). However, I'm not too sure on how to ADD data.

I have connected to a Microsoft Access Database. The TABLE is called "UserNotes". Which has the following headers:

StudentID          Username          Password          Notes
(AutoNumber)

How do I then ADD a Username, Password and Notes??

Thanks alot! :D
[r.D]
LVL 9
DrWarezzAsked:
Who is Participating?
 
sigmaconCommented:
Hi DrWarezz,

Assuming you already have a JDBC connection named conn (from your select statment):


Statement stmt = conn.createStatement();
stmt.executeUpdate("insert into UserNotes (Username, Password, Notes) values ('DrWarezz', 'secretpassword','DW is da man') ");


Good luck!
0
 
DrWarezzAuthor Commented:
:D Excellent -- thanks alot Signmacon.

[r.D]
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.