| line 1 | import the IO classes |
| line 2-3 | import the servlet classes |
| line 4 | import the SQL classes |
| line 6 | define the HelloDatabase class |
| line 8 | Declare the member variable to hold the connection reference |
| line 9 | this begins our override of init() |
| line 12 | delegate the work to the super class |
| line 13 | start a try/catch block |
| line 15 | load and register the JDBC/ODBC bridge as our JDBC driver |
| line 16 | open a connection to the DSN |
| line 19 | this exception might be thrown by the Class.forName() call |
| line 21 | this message will appear on the console where you started the Web server |
| line 24 | the exception might be thrown by the getConnection() call |
| line 26 | this message will appear on the console where you started the Web server |
| line 30 | this begins our override of destroy() |
| line 32 | start a try/catch block |
| line 34 | close the database connection |
| line 36 | the exception might be thrown by the close() call |
| line 38 | this message will appear on the console where you started the Web server |
| line 42 | the remainder of the servlet was omitted for space reasons |