1 | Connection con = DriverManager.getConnection ( |
2 | url, "my-user", "my-passwd"); |
3 | |
4 | // If we were unable to connect, an exception |
5 | // would have been thrown. So, if we get here, |
6 | // we are successfully connected to the URL |
7 | |
8 | // Get the DatabaseMetaData object and display |
9 | // some information about the connection |
10 | |
11 | DatabaseMetaData dma = con.getMetaData (); |
12 | |
13 | System.out.println("\nConnected to " + dma.getURL()); |
14 | System.out.println("Driver " + |
15 | dma.getDriverName()); |
16 | System.out.println("Version " + |
17 | dma.getDriverVersion()); |
18 | System.out.println(""); |