• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help on JDBC mini project

 
Nilesh Sanyal
Ranch Hand
Posts: 33
Eclipse IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am developing a core java application which is menu driven as follows.

Sample Database Application
===========================
1)Add record 2)Update record 3)Delete record 4)Display record 5)Quit

I am using Oracle 11g express edition Release 11.2.0.2.0 and Oracle thin driver ojdbc14-10.2.0.3.0.jar file. Add record, delete record and display record works fine, but problem is in updateRecord() method.

Sample output
--------------------


Sample Database Application
===========================
1)Add record 2)Update record 3)Delete record 4)Display record 5)Quit
Enter your choice(1/2/3/4/5):
4
nilesh 1234
pijush 2345
Do you want to continue(1/0)?
1
Sample Database Application
===========================
1)Add record 2)Update record 3)Delete record 4)Display record 5)Quit
Enter your choice(1/2/3/4/5):
2
Enter user id:
nilesh
Enter user's password:
5555
Update failed!!
Do you want to continue(1/0)?
0

Codes for updateRecord() method
----------------------------------------


Please help me
 
K. Tsang
Bartender
Posts: 3583
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should UseCodeTags, I have added code tags for you, doesn't the code look better to read?

As for your problem, you got the 2 parameters reversed, hence the update failed.



The 1st parameter is the password and 2nd the username.


 
Nilesh Sanyal
Ranch Hand
Posts: 33
Eclipse IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for your help, now it is working properly. Next time I will use CodeTags for posting codes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic