You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Richard N. Hillegas (Jira)" <ji...@apache.org> on 2021/02/28 16:54:00 UTC

[jira] [Commented] (DERBY-7103) getProcedureColumn(...)/SCALE is Integer not Short

    [ https://issues.apache.org/jira/browse/DERBY-7103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17292439#comment-17292439 ] 

Richard N. Hillegas commented on DERBY-7103:
--------------------------------------------

I'm afraid I don't understand what improvement is being requested. The following program...

{noformat}
import java.sql.*;

public class Z
{
    public static void main(String... args) throws Exception
    {
        Connection conn = DriverManager.getConnection("jdbc:derby:memory:db;create=true");
        DatabaseMetaData dbmd = conn.getMetaData();
        ResultSet rs = dbmd.getProcedureColumns(null, null, "%", "%");
        ResultSetMetaData rsmd = rs.getMetaData();
        int numColumns = rsmd.getColumnCount();

        for (int idx = 1; idx <= numColumns; idx++)
        {
            println
                (
                 rsmd.getColumnName(idx) + " has type " + rsmd.getColumnTypeName(idx) +
                 " of JDBC type " + rsmd.getColumnType(idx)
                 );
        }
    }

    private static void println(String text) { System.out.println(text); }
}
{noformat}

...reports the following output:

{noformat}
PROCEDURE_CAT has type VARCHAR of JDBC type 12
PROCEDURE_SCHEM has type VARCHAR of JDBC type 12
PROCEDURE_NAME has type VARCHAR of JDBC type 12
COLUMN_NAME has type VARCHAR of JDBC type 12
COLUMN_TYPE has type SMALLINT of JDBC type 5
DATA_TYPE has type INTEGER of JDBC type 4
TYPE_NAME has type VARCHAR of JDBC type 12
PRECISION has type INTEGER of JDBC type 4
LENGTH has type INTEGER of JDBC type 4
SCALE has type SMALLINT of JDBC type 5
RADIX has type SMALLINT of JDBC type 5
NULLABLE has type SMALLINT of JDBC type 5
REMARKS has type VARCHAR of JDBC type 12
COLUMN_DEF has type VARCHAR of JDBC type 12
SQL_DATA_TYPE has type INTEGER of JDBC type 4
SQL_DATETIME_SUB has type INTEGER of JDBC type 4
CHAR_OCTET_LENGTH has type INTEGER of JDBC type 4
ORDINAL_POSITION has type INTEGER of JDBC type 4
IS_NULLABLE has type VARCHAR of JDBC type 12
SPECIFIC_NAME has type VARCHAR of JDBC type 12
METHOD_ID has type SMALLINT of JDBC type 5
PARAMETER_ID has type SMALLINT of JDBC type 5
{noformat}

The SCALE column of DatabaseMetaData.getProcedureColumns() has SQL type SMALLINT, a 16-bit signed integer. Can you attach a repro which shows the behavior you think is wrong and explain in greater detail what improvement you think is needed? Thanks.


> getProcedureColumn(...)/SCALE is Integer not Short
> --------------------------------------------------
>
>                 Key: DERBY-7103
>                 URL: https://issues.apache.org/jira/browse/DERBY-7103
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC
>    Affects Versions: 10.14.2.0
>            Reporter: Jin Kwon
>            Priority: Major
>
> When [getProcedureColumns(...)|https://docs.oracle.com/en/java/javase/11/docs/api/java.sql/java/sql/DatabaseMetaData.html#getProcedureColumns(java.lang.String,java.lang.String,java.lang.String,java.lang.String)] invoked, the {{SCALE}} column returns an {{Integer}} not an {{Short}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)