@@ -726,7 +726,7 @@ public void testBoolean(int prepareThreshold) throws SQLException {
726
726
pstmt .setObject (2 , BigDecimal .ONE , Types .BOOLEAN );
727
727
pstmt .setObject (3 , 0L , Types .BOOLEAN );
728
728
pstmt .setObject (4 , 0x1 , Types .BOOLEAN );
729
- pstmt .setObject (5 , new Float ( 0 ) , Types .BOOLEAN );
729
+ pstmt .setObject (5 , ( float ) 0 , Types .BOOLEAN );
730
730
pstmt .setObject (5 , 1.0d , Types .BOOLEAN );
731
731
pstmt .setObject (5 , 0.0f , Types .BOOLEAN );
732
732
pstmt .setObject (6 , Integer .valueOf ("1" ), Types .BOOLEAN );
@@ -859,11 +859,11 @@ public void testSetFloatInteger() throws SQLException {
859
859
pstmt .executeUpdate ();
860
860
pstmt .close ();
861
861
862
- Integer maxInteger = new Integer ( 2147483647 ) ;
863
- Integer minInteger = new Integer ( -2147483648 ) ;
862
+ Integer maxInteger = 2147483647 ;
863
+ Integer minInteger = -2147483648 ;
864
864
865
- Double maxFloat = new Double ( 2147483647 ) ;
866
- Double minFloat = new Double ( -2147483648 ) ;
865
+ Double maxFloat = 2147483647.0 ;
866
+ Double minFloat = ( double ) -2147483648 ;
867
867
868
868
pstmt = con .prepareStatement ("insert into float_tab values (?,?,?)" );
869
869
pstmt .setObject (1 , maxInteger , Types .FLOAT );
@@ -896,8 +896,8 @@ public void testSetFloatString() throws SQLException {
896
896
897
897
String maxStringFloat = "1.0E37" ;
898
898
String minStringFloat = "1.0E-37" ;
899
- Double maxFloat = new Double ( 1.0E37 ) ;
900
- Double minFloat = new Double ( 1.0E-37 ) ;
899
+ Double maxFloat = 1.0E37 ;
900
+ Double minFloat = 1.0E-37 ;
901
901
902
902
pstmt = con .prepareStatement ("insert into float_tab values (?,?,?)" );
903
903
pstmt .setObject (1 , maxStringFloat , Types .FLOAT );
@@ -939,8 +939,8 @@ public void testSetFloatBigDecimal() throws SQLException {
939
939
940
940
BigDecimal maxBigDecimalFloat = new BigDecimal ("1.0E37" );
941
941
BigDecimal minBigDecimalFloat = new BigDecimal ("1.0E-37" );
942
- Double maxFloat = new Double ( 1.0E37 ) ;
943
- Double minFloat = new Double ( 1.0E-37 ) ;
942
+ Double maxFloat = 1.0E37 ;
943
+ Double minFloat = 1.0E-37 ;
944
944
945
945
pstmt = con .prepareStatement ("insert into float_tab values (?,?,?)" );
946
946
pstmt .setObject (1 , maxBigDecimalFloat , Types .FLOAT );
@@ -971,10 +971,10 @@ public void testSetTinyIntFloat() throws SQLException {
971
971
pstmt .executeUpdate ();
972
972
pstmt .close ();
973
973
974
- Integer maxInt = new Integer ( 127 ) ;
975
- Integer minInt = new Integer ( -127 ) ;
976
- Float maxIntFloat = new Float ( 127 ) ;
977
- Float minIntFloat = new Float ( -127 ) ;
974
+ Integer maxInt = 127 ;
975
+ Integer minInt = -127 ;
976
+ Float maxIntFloat = 127F ;
977
+ Float minIntFloat = ( float ) -127 ;
978
978
979
979
pstmt = con .prepareStatement ("insert into tiny_int values (?,?,?)" );
980
980
pstmt .setObject (1 , maxIntFloat , Types .TINYINT );
@@ -1027,10 +1027,10 @@ public void testSetSmallIntFloat() throws SQLException {
1027
1027
pstmt .executeUpdate ();
1028
1028
pstmt .close ();
1029
1029
1030
- Integer maxInt = new Integer ( 32767 ) ;
1031
- Integer minInt = new Integer ( -32768 ) ;
1032
- Float maxIntFloat = new Float ( 32767 ) ;
1033
- Float minIntFloat = new Float ( -32768 ) ;
1030
+ Integer maxInt = 32767 ;
1031
+ Integer minInt = -32768 ;
1032
+ Float maxIntFloat = 32767F ;
1033
+ Float minIntFloat = ( float ) -32768 ;
1034
1034
1035
1035
pstmt = con .prepareStatement ("insert into small_int values (?,?,?)" );
1036
1036
pstmt .setObject (1 , maxIntFloat , Types .SMALLINT );
@@ -1060,10 +1060,10 @@ public void testSetIntFloat() throws SQLException {
1060
1060
pstmt .executeUpdate ();
1061
1061
pstmt .close ();
1062
1062
1063
- Integer maxInt = new Integer ( 1000 ) ;
1064
- Integer minInt = new Integer ( -1000 ) ;
1065
- Float maxIntFloat = new Float ( 1000 ) ;
1066
- Float minIntFloat = new Float ( -1000 ) ;
1063
+ Integer maxInt = 1000 ;
1064
+ Integer minInt = -1000 ;
1065
+ Float maxIntFloat = 1000F ;
1066
+ Float minIntFloat = ( float ) -1000 ;
1067
1067
1068
1068
pstmt = con .prepareStatement ("insert into int_tab values (?,?,?)" );
1069
1069
pstmt .setObject (1 , maxIntFloat , Types .INTEGER );
@@ -1094,8 +1094,8 @@ public void testSetBooleanDouble() throws SQLException {
1094
1094
pstmt .executeUpdate ();
1095
1095
pstmt .close ();
1096
1096
1097
- Double dBooleanTrue = new Double ( 1 ) ;
1098
- Double dBooleanFalse = new Double ( 0 ) ;
1097
+ Double dBooleanTrue = 1.0 ;
1098
+ Double dBooleanFalse = ( double ) 0 ;
1099
1099
1100
1100
pstmt = con .prepareStatement ("insert into double_tab values (?,?,?)" );
1101
1101
pstmt .setObject (1 , Boolean .TRUE , Types .DOUBLE );
@@ -1349,7 +1349,7 @@ public void testUnknownSetObject() throws SQLException {
1349
1349
@ Test
1350
1350
public void testSetObjectCharacter () throws SQLException {
1351
1351
PreparedStatement ps = con .prepareStatement ("INSERT INTO texttable(te) VALUES (?)" );
1352
- ps .setObject (1 , new Character ( 'z' ) );
1352
+ ps .setObject (1 , 'z' );
1353
1353
ps .executeUpdate ();
1354
1354
ps .close ();
1355
1355
}
@@ -1362,7 +1362,7 @@ public void testSetObjectCharacter() throws SQLException {
1362
1362
@ Test
1363
1363
public void testStatementDescribe () throws SQLException {
1364
1364
PreparedStatement pstmt = con .prepareStatement ("SELECT ?::int" );
1365
- pstmt .setObject (1 , new Integer ( 2 ) , Types .OTHER );
1365
+ pstmt .setObject (1 , 2 , Types .OTHER );
1366
1366
for (int i = 0 ; i < 10 ; i ++) {
1367
1367
ResultSet rs = pstmt .executeQuery ();
1368
1368
assertTrue (rs .next ());
0 commit comments