• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Save elements from JList into mysql

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Marshal
Posts: 79257
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the code that i use :

 
Campbell Ritchie
Marshal
Posts: 79257
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you
 
Jeanne Boyarsky
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to Swing forum so in right place for future people with same problem.
 
Watchya got in that poodle gun? Anything for me? Or this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic