Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"How to" JSP mySQL question

Status
Not open for further replies.

zeero

Programmer
Aug 4, 2004
60
US
Hi all, I am new to JSP. What I'm trying to do is to create a system in JSP for mySQL entries. I have some code for the actual insertion and I made a form for somebody to type the info in for the table. Now here is what I'm trying to do.. I have multiple servers each with its own db to connect to. I was thinking I could I make a drop-down box with the server names, have the user choose a server, then type in the information they want inserted through the forms to the db. If so, would a switch statement work to actually go about handling how to choose a server? (e.g. once they choose a server from the drop-down box, the IP address to that particular server will be used). Hope this makes sense. :)
 
Depends on the data type on which you are 'switching' on - if it is a primitive data type (char, int, long etc) then OK, but you cannot switch on an Object (and a String is an Object). You shall probably need to use a standard if/else if/else construct.

--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top