Where does the database code go in case of the MVC model? We could take the example SimpleCommand.war (http://www.coderanch.com/how-to/java/CodeBarnSimpleCommand) as a reference. So would the database connection go in one of the 'command classes'? If yes, then the database connection code would be part of the controller and not the model right?
Yeah, if you are a fan of the service pattern, that's one way of doing it. Regardless, the point is that by keeping the presentation layer (controller/view) free from detailed information of how the model is getting/storing its data, the presentation layer stays decoupled from the details that only the model should have to deal with. This frees the model to do whatever it wants (use a database, use flat files, use stone knives and bearskins, use mock objects for testing, et cetera...)