Getting the Maximum Table Name Length in a Database - Java JDBC

Java examples for JDBC:Database Meta Data

Description

Getting the Maximum Table Name Length in a Database

Demo Code

import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.SQLException;

public class Main {
  public static void main(String[] argv) {
    try {//from   w ww.j  av a 2s  .  c o m
      Connection connection = null;
      // Gets database metadata
      DatabaseMetaData dbmd = connection.getMetaData();

      // Get max table name length
      int length = dbmd.getMaxTableNameLength();
    } catch (SQLException e) {
    }
  }
}

Related Tutorials