• Post Reply Bookmark Topic Watch Topic
  • New Topic

Save elements from JList into mysql

 
yesaya handoyo
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,i want to ask..I got two tables,one is user_rights contain usrname and menu,another one is user_menu contain menu and description.The menu field contain such "mnuUser",so if the user has the right to the User menu,the form will be displayed.The description is for display what kind of menu such "Menu-Master-User".I use two JList,one is to display the description.The other one is for holding the description that the user had choosed.What i want to ask is how to save the menu instead of the description into the user_rights?And also how to display the description in the Jlist2?Thanks a lot..
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35707
407
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yesaya,
Are you asking how to get the data from the JLists into Java Strings or how to get the Java Strings into the database?
 
yesaya handoyo
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeanne,i need help about saving Strings from JList into database.I got 2 table,one is user_rights contain username and menu,the other one is user_menu contain menu and description.I put the JMenu name into the menu field for authorizing the user.And what i display in the JList is the desc which contains the description for the menu.For examples..The menu is mnuUser,then the desc is Menu-Master-User..The data that i would like to save is the menu,not the desc..Thanks a lot...
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35707
407
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yesaya,
I understand the problem. I'm trying to pinpoint where you are stuck. When faced with a hard problem, it is best to break it down into smaller problems.

1) Get the data you want to put in the database and print the data to the screen
2) Take data from variables and stick it in the database.

Which of the two are you stuck on? If you are stuck on both, which do you want to discuss first?
 
yesaya handoyo
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never mind Jeanne..I'ved worked it out.I read the api about JList..And i have got it work..Thanks a lot Jeanne.May God bless you for your help...
 
Campbell Ritchie
Marshal
Posts: 52513
118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please tell us how you sorted the problem; it will help other readers who have the same problem in the future.
 
yesaya handoyo
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the code that i use :

 
Campbell Ritchie
Marshal
Posts: 52513
118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35707
407
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Swing forum so in right place for future people with same problem.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!