getTableTypes Method (SQLServerDatabaseMetaData)

Retrieves the table types that are available in the current database.

public java.sql.ResultSet getTableTypes()

Valor devuelto

A SQLServerResultSet object.

Excepciones

SQLServerException

Observaciones

This getTableTypes method is specified by the getTableTypes method in the java.sql.DatabaseMetaData interface.

The result set returned by the getTableTypes method will contain the following information:

Name Type Description

TABLE_TYPE

String

The table type.

Nota

For more information about the data returned by the getTableTypes method, see "sp_tables (Transact-SQL)" in SQL Server Books Online.

Ejemplo

The following example demonstrates how to use the getTableTypes method to return the table type information in the SQL Server 2005 AdventureWorks sample database, given that the database is specified in the connection String.

public static void executeGetTableTypes(Connection con) {
   try {
      DatabaseMetaData dbmd = con.getMetaData();
      ResultSet rs = dbmd.getTableTypes();
      ResultSetMetaData rsmd = rs.getMetaData();

      // Display the result set data.
      int cols = rsmd.getColumnCount();
      while(rs.next()) {
         for (int i = 1; i <= cols; i++) {
            System.out.println(rs.getString(i));
         }
      }
      rs.close();
   } 

   catch (Exception e) {
      e.printStackTrace();
   }
}

Vea también

Referencia

SQLServerDatabaseMetaData Class

Conceptos

SQLServerDatabaseMetaData Methods
SQLServerDatabaseMetaData Members