DatabaseMetaData dbmd = null:
try {
dbmd = c.getMetaData():
} catch (SQLException se) {
System.out.printlnC'We got an exception while getting the metadata:" +
" check the connection."):
se.printStackTrace():
System.exit(l): }
String username = null:
try {
username = dbmd.getUserName():
} catch (SQLException se) {
System.out.printlnC'We got an exception while getting the username:" +
"check the connection.");
se.printStackTraceO;
System.exit(l):
}
String url = null;
try {
url = dbmd.getURLO;
} catch (SQLException se) {
System.out.printlnC'We got an exception while getting the URL:" +
"check the connection.");
se.printStackTrace();
System.exit(l):
}
System.out.printlnC'You are connected to '" + url +
'" with user name '" + username + .....);
Как было сказано выше, лучшим источником информации о других методах DatabaseMetaData является документация JDK API.