deprecated method generation
Brought to you by:
taweili
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.
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);
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) + ")");
}