Menu

#6 deprecated method generation

open
nobody
None
5
2001-06-11
2001-06-11
Anonymous
No

in DbGen.java the line

output.print("rs." + getJdbcGetMethod(f) + "(" + (i +
1) + ", " + f.getScale() + ")");

is generating a deprecated method.
java.sql.Recordset.BigDecimal(1, 0)

Why getBigDecimal(1, 0) is deprecated
I don't know, but I changed it so the f.getScale
paramter is not created.

This may not be the right workaround, but for my case,
I only have two tables that use the scale.

Discussion

  • Nobody/Anonymous

    Logged In: NO

    according to http://forums.java.sun.com/thread.jsp?
    forum=48&thread=89625

    I could use
    Only the getBigDecimal method with two parameters (second
    parameter "scale") is deprecated. So maybe instead of

    rs.getBigDecimal("YTD", 2);

    you could use

    rs.getBigDecimal("YTD").setScale(2);

     
  • Nobody/Anonymous

    Logged In: NO

    in the protected void makeMakeObjectMethod(Table table)
    method
    I changed the code as follows
    ...
    if (f.isDecimalType())
    {
    //output.print("rs." + getJdbcGetMethod(f) + "(" +
    (i + 1) + ", " + f.getScale() + ")");
    if (f.getScale() != 0){
    System.out.println("remember this !!!
    table " + table.getClassName() + ", field " + f.getName()
    + " = " + f.getScale());
    output.print("rs." + getJdbcGetMethod(f)
    + "(" + (i + 1) + ", " + f.getScale() + ")");
    } else
    output.print("rs." + getJdbcGetMethod(f)
    + "(" + (i + 1) + ")");
    }

     

Log in to post a comment.

MongoDB Logo MongoDB