import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
public class DBMetaDataEx {
public static void main(String[] args){
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
try {
Class.forName("org.apache.derby.jdbc.ClientDriver");
String url = "jdbc:derby://localhost:1527/hari";
con = DriverManager.getConnection(url, "app","app");
DatabaseMetaData dbmd = con.getMetaData();
System.out.println(""+dbmd.getDatabaseProductName());
System.out.println(""+dbmd.getDatabaseProductVersion());
System.out.println(""+dbmd.getSQLKeywords());
System.out.println(""+dbmd.getStringFunctions());
System.out.println(""+dbmd.getDriverName());
System.out.println(dbmd.getJDBCMajorVersion());
System.out.println(dbmd.getJDBCMinorVersion());
}catch(Exception ex){
}}
}
No comments:
Post a Comment