This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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.
Please UseRealWords: "for" not "4"; "someone" not "som1". "little" not "lil". "Have a nice day" not "Havanice day".