* GREY=local LOCAL HTML version of Foils prepared 13 March 1997

Foil 23 Example - Using JDBC-ODBC Bridge - II

From Overview of Java Database Connection Basic Information Technology Course CPS616 -- Spring Semester 1997. by Udayan Parvate, Tom Pulikal (Geoffrey C. Fox) *

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("");

Table Font Size


Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Tue Jul 22 1997