• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Solved : Java CheckBox to insert data

 
Sander Silva
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem solved, Thank you very much for all who read and reply.

I'm using Netbeans 7.0 to develop a programme to Insert data into a MS Access database.


 
Rob Spoor
Sheriff
Pie
Posts: 20514
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Could you next time please indent your code? It's almost impossible to read like this.

Sander Silva wrote:

1) There is no difference between insert2, insert3 and insert4. All that differs is the arguments when you call them. Make them into two methods, and rename them for clarity.
2) Those execute lines won't even compile; that's not how you concatenate Strings. You need + for that:
Of course, PreparedStatement is the preferred way because it prevents SQL injection (look it up if you don't know what that means).

My program is now able to add all 3 fileds via it's UI.
I have 3 colors in 3 checkboxes, now it is only capable of
adding only 1 color at a time. When I select more than 1 color (2 or3)
it's not working.

That's because you only call insert1 and insert2. You never call insert3 or insert4. You'll need to call four insert statements:

Thank you very much 4 reading my post. Hope som1 can give lil help.
Havanice day!

Please UseRealWords: "for" not "4"; "someone" not "som1". "little" not "lil". "Have a nice day" not "Havanice day".
 
Sander Silva
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh woderful reply. 100% clear.
My problem is fully solved.
Thank you 1000 times!
 
Darryl Burke
Bartender
Posts: 5125
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sander Silva wrote: Oh woderful reply. 100% clear.
My problem is fully solved.

I'm happy for you, but wouldn't you like to share your joy with the good folks over at the Oracle forums, so they don't waste time on your question?

Here too, we ask that you BeForthrightWhenCrossPostingToOtherSites
 
Sander Silva
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh Sorry for wasting time on others. I delete all my posts @ other forums including Oracle forum.
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sander Silva wrote:. . .. I delete all my posts @ other forums including Oracle forum. . . .
No, don't delete any posts. It makes the replies look nonsensical. What you should do is post a link saying "somebody on JavaRanch helped me," or similar.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic