11/*
2- * Copyright (c) 2003, 2013 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2003, 2021 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
4545 *
4646 * @author Jonathan Bruce, Amit Handa
4747 */
48+
4849public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet , Joinable {
4950
5051 /**
5152 * The {@code Connection} object that is this rowset's
5253 * current connection to the database. This field is set
5354 * internally when the connection is established.
5455 */
56+ @ SuppressWarnings ("serial" )
5557 private Connection conn ;
5658
5759 /**
@@ -60,6 +62,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
6062 * {@code execute} creates the {@code PreparedStatement}
6163 * object.
6264 */
65+ @ SuppressWarnings ("serial" )
6366 private PreparedStatement ps ;
6467
6568 /**
@@ -68,6 +71,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
6871 * {@code execute} executes the rowset's command and thereby
6972 * creates the rowset's {@code ResultSet} object.
7073 */
74+ @ SuppressWarnings ("serial" )
7175 private ResultSet rs ;
7276
7377 /**
@@ -84,6 +88,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
8488 * {@code RowSetMetaDataImpl} is formed and which helps in getting
8589 * the metadata information.
8690 */
91+ @ SuppressWarnings ("serial" )
8792 private ResultSetMetaData resMD ;
8893
8994
@@ -628,7 +633,7 @@ private Connection connect() throws SQLException {
628633 (getDataSourceName ());
629634 //return ds.getConnection(getUsername(),getPassword());
630635
631- if (getUsername () != null && !getUsername ().equals ( "" )) {
636+ if (getUsername () != null && !getUsername ().isEmpty ( )) {
632637 return ds .getConnection (getUsername (),getPassword ());
633638 } else {
634639 return ds .getConnection ();
@@ -1137,7 +1142,7 @@ public java.io.InputStream getAsciiStream(int columnIndex) throws SQLException {
11371142 * as a stream of Unicode characters.
11381143 * The value can then be read in chunks from the
11391144 * stream. This method is particularly
1140- * suitable for retrieving large{@code LONGVARCHAR}values. The JDBC driver will
1145+ * suitable for retrieving large{@code LONGVARCHAR} values. The JDBC driver will
11411146 * do any necessary conversion from the database format into Unicode.
11421147 * The byte format of the Unicode stream must be Java UTF-8,
11431148 * as specified in the Java virtual machine specification.
@@ -3877,7 +3882,7 @@ public void setMatchColumn(int[] columnIdxes) throws SQLException {
38773882 public void setMatchColumn (String [] columnNames ) throws SQLException {
38783883
38793884 for (int j = 0 ; j < columnNames .length ; j ++) {
3880- if ( columnNames [j ] == null || columnNames [j ].equals ( "" )) {
3885+ if ( columnNames [j ] == null || columnNames [j ].isEmpty ( )) {
38813886 throw new SQLException (resBundle .handleGetObject ("jdbcrowsetimpl.matchcols2" ).toString ());
38823887 }
38833888 }
@@ -3932,7 +3937,7 @@ public void setMatchColumn(int columnIdx) throws SQLException {
39323937 */
39333938 public void setMatchColumn (String columnName ) throws SQLException {
39343939 // validate, if col is ok to be set
3935- if (columnName == null || (columnName = columnName .trim ()).equals ( "" )) {
3940+ if (columnName == null || (columnName = columnName .trim ()).isEmpty ( )) {
39363941 throw new SQLException (resBundle .handleGetObject ("jdbcrowsetimpl.matchcols2" ).toString ());
39373942 } else {
39383943 // set strMatchColumn
@@ -6192,7 +6197,7 @@ public void setTime(String parameterName, java.sql.Time x, Calendar cal)
61926197 * @param parameterIndex index of the first parameter is 1, the second is 2, ...
61936198 * @param reader An object that contains the data to set the parameter value to.
61946199 * @throws SQLException if a database access error occurs, this method is called on
6195- * a closed {@code PreparedStatement}or if parameterIndex does not correspond to a parameter
6200+ * a closed {@code PreparedStatement} or if parameterIndex does not correspond to a parameter
61966201 * marker in the SQL statement
61976202 *
61986203 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method
0 commit comments