This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Welcome to the Ranch
I have added code tags to your code, which make it look much better and clicked the disable smilies box, so :odbc doesn’t appear as dbc.
What exactly goes wrong? Do you suffer an Exception? It would be better to use ex.printStackTrace();, so you would know the exact details of the Exception, including where it occurred. How did you add that driver to your classpath?