Code example for DatabaseMetaData

Methods: getDatabaseMajorVersiongetDatabaseMinorVersiongetDatabaseProductName

0
			conn = ConnectionUtil.getConnection(av[0]);
			 
			// Do something with the connection here... 
			final DatabaseMetaData metaData = conn.getMetaData();
			System.out.printf("Database name %s%n",
					metaData.getDatabaseProductName());
			System.out.printf("Database version %d.%d%n",
					metaData.getDatabaseMajorVersion(),
					metaData.getDatabaseMinorVersion());
 
	    } catch (SQLException e) {
			System.out.println("Database problem " + e);
			e.printStackTrace();
	    } finally { 
	    	if (conn != null)
	    		conn.close();	// Done with that DB connection
	    } 
	} 
} 
Contextual code suggestions in your IDE  Get Codota for Java