Search Java Code Snippets

  Help us in improving the repository. Add new snippets through 'Submit Code Snippet ' link.

#Java - Code Snippets for '#Java.sql.DatabaseMetaData' - 1 code snippet(s) found

 Sample 1. Code Sample / Example / Snippet of java.sql.DatabaseMetaData

  private String mm(int majorVersion, int minorVersion) {

return majorVersion + "." + minorVersion;


@Test public void testMetaDataColumns()

throws ClassNotFoundException, SQLException {

Connection connection = CalciteAssert


DatabaseMetaData metaData = connection.getMetaData();

ResultSet resultSet = metaData.getColumns(null, null, null, null);

assertTrue(; // there's something

String name = resultSet.getString(4);

int type = resultSet.getInt(5);

String typeName = resultSet.getString(6);

int columnSize = resultSet.getInt(7);

int decimalDigits = resultSet.getInt(9);

int numPrecRadix = resultSet.getInt(10);

int charOctetLength = resultSet.getInt(16);

String isNullable = resultSet.getString(18);




   Like      Feedback      java.sql.DatabaseMetaData

Subscribe to Java News and Posts. Get latest updates and posts on Java from
Enter your email address:
Delivered by FeedBurner