OK, I've got to be missing something simple. I'm trying to use one servlet as a standard getter/setter (I'm assuming the problem isn't in that file, but one never knows). I use another servlet to prepare the data for viewing and/or for updating. I use yet another to call to the database and a controller servlet to tie it all together. Nothing is happening, but I've fiddled with it so many times that i can't figure out where the problem is. I think that either I'm not connecting to the database correctly (derby database) and/or I'm not calling items correctly. Can someone take a look? I'd greatly appreciate it! I never really learned servlets that well and have moved on to coding in other languages...and have yet to connect to a database in any of them (yes, most of them are educational exercises).
You mentioned two specific bits: Database connection, and not calling items correctly.
Lets try and narrow it down to the important parts.
Your DB Connection code:
What I don't like about this is that if you get an error connecting to the database, it will just continue on as if nothing has happened.
At the least you should print out the error message. More likely you should just let it throw the exception, or throw a new exception at this point if you don't have a connection. If its gonna fail, you may as well fail fast.
Returning "null" from this method just means you will get a null pointer exception in some unrelated part of the code making it harder to debug.
And time for some questions:
How are you invoking this servlet?
What result do you get?
Any messages in the log?
I would suggest adding some debug logging into your code, so that you can see the flow of information/parameters around and get an idea of where things fall down.