Java SQL Type dumpTypes(Connection pConnection)

Here you can find the source of dumpTypes(Connection pConnection)

Description

dump Types

License

Apache License

Declaration

public static void dumpTypes(Connection pConnection) throws SQLException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;

public class Main {
    public static void dumpTypes(Connection pConnection) throws SQLException {
        try (ResultSet rs = pConnection.getMetaData().getTypeInfo()) {
            System.out.println(//from w  w  w.  ja v a 2s. com
                    "TYPE_NAME,DATA_TYPE,PRECISION,LITERAL_PREFIX,LITERAL_SUFFIX,CREATE_PARAMS,NULLABLE,CASE_SENSITIVE,SEARCHABLE,UNSIGNED_ATTRIBUTE,FIXED_PREC_SCALE,AUTO_INCREMENT,LOCAL_TYPE_NAME,MINIMUM_SCALE,MAXIMUM_SCALE,SQL_DATA_TYPE,SQL_DATETIME_SUB,NUM_PREC_RADIX");
            while (rs.next() == true) {
                System.out.print(rs.getString(1));
                System.out.print(",");
                System.out.print(rs.getInt(2));
                System.out.print(",");
                System.out.print(rs.getInt(3));
                System.out.print(",");
                System.out.print(rs.getString(4));
                System.out.print(",");
                System.out.print(rs.getString(5));
                System.out.print(",");
                System.out.print(rs.getString(6));
                System.out.print(",");
                System.out.print(rs.getShort(7));
                System.out.print(",");
                System.out.print(rs.getBoolean(8));
                System.out.print(",");
                System.out.print(rs.getShort(9));
                System.out.print(",");
                System.out.print(rs.getBoolean(10));
                System.out.print(",");
                System.out.print(rs.getBoolean(11));
                System.out.print(",");
                System.out.print(rs.getBoolean(12));
                System.out.print(",");
                System.out.print(rs.getString(13));
                System.out.print(",");
                System.out.print(rs.getShort(14));
                System.out.print(",");
                System.out.print(rs.getShort(15));
                System.out.print(",");
                System.out.print(rs.getInt(16));
                System.out.print(",");
                System.out.print(rs.getInt(17));
                System.out.print(",");
                System.out.print(rs.getInt(18));
                System.out.println();
            }
        }
    }
}

Related

  1. createTestData()
  2. decodeJavaType(Object pType)
  3. deleteData(Connection conn)
  4. deleteFromAllTables(Connection con)
  5. deserializeSQLTypesToJava(String sqltypename, String value)
  6. extractConstant(String typeName)
  7. fillLogParams(String sql, Map logParams)
  8. findMethod(Class returnType, Class parameterType)
  9. getAntipodeForFunction(String base, int destType)