Skip to content

Commit 0033213

Browse files
Merge pull request #2 from bpangburn/1.0.3-SNAPSHOT
1.0.3 snapshot
2 parents 23d0a1a + b3c408c commit 0033213

File tree

4 files changed

+88
-24
lines changed

4 files changed

+88
-24
lines changed

CHANGELOG.txt

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
==============================================================================
2+
ChangeLog file for the JdbcRowSet interface from OpenJDK
3+
==============================================================================
4+
5+
==============================================================================
6+
JdbcRowSetImpl 1.0.3 - Released 2021-10-18
7+
==============================================================================
8+
9+
Changes:
10+
1. Added CHANGELOG
11+
2. Updated dependency/plugin versions in POM
12+
3. Changes based on 2021-09-27 version of JdbcRowSetImpl from:
13+
https://github.com/openjdk/jdk/blob/426bcee9274bb3ec7dce551f85adb2ab61c22481/src/java.sql.rowset/share/classes/com/sun/rowset/JdbcRowSetImpl.java
14+
a. Replace use of string.equals("") with isEmpty() (2018-12-07)
15+
b. Various Typos in SQL Method Documentation (2019-01-03)
16+
c. Added '@SuppressWarnings("serial")' to various datamembers (2021-09-27)
17+
18+
==============================================================================
19+
JdbcRowSetImpl 1.0.2 - Released 2020-09-20
20+
==============================================================================
21+
22+
Changes:
23+
1. Fixed PATH constant in RowSetResourceBundle
24+
2. Moved ResourceBundles into src/main/resources
25+
26+
27+
==============================================================================
28+
JdbcRowSetImpl 1.0.1 - Released 2020-08-14
29+
==============================================================================
30+
31+
Changes:
32+
1. Updated project description
33+
2. Corrected bad URL in POM
34+
35+
36+
==============================================================================
37+
JdbcRowSetImpl 1.0.0 - Released 2020-08-13
38+
==============================================================================
39+
40+
Changes:
41+
1. Initial Release
42+

README.md

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ https://stackoverflow.com/questions/48129475/java-error-package-com-sun-rowset-i
1616
For backwards compatibility and to allow for the continued leverage of connection reuse with
1717
setConnection(), we're creating this jdbcrowsetimpl Maven artifact.
1818

19-
It is based on the latest OpenJDK 14 code available from: https://hg.openjdk.java.net/jdk/jdk14
19+
It is based on the latest OpenJDK 17 code available from: https://github.com/openjdk/jdk
2020

2121
1. JdbcRowSetImpl.java
2222
2. JdbcRowSetResourceBundle.java
@@ -32,7 +32,7 @@ It is based on the latest OpenJDK 14 code available from: https://hg.openjdk.jav
3232
12. RowSetResourceBundle_zh_TW.properties
3333
13. RowSetResourceBundle.properties
3434

35-
The constructor for JdbcRowSetResourceBundle is modified around line 100 based on the Java 8 version of the file:
35+
The constructor for JdbcRowSetResourceBundle is modified around line 105 based on the Java 8 version of the file:
3636
https://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/share/classes/com/sun/rowset/JdbcRowSetResourceBundle.java
3737
```
3838
// Load appropriate bundle according to locale
@@ -47,9 +47,9 @@ Is replaced with:
4747
```
4848
This allows the code to continue to work with Java 8.
4949

50-
In addition the path specified in JdbcRowSetResourceBundle.java needs to be updated near line 87 from:
50+
In addition the path specified in JdbcRowSetResourceBundle.java needs to be updated near line 83 from:
5151
```
52-
private static final String PATH = "com/sun/rowset/RowSetResourceBundle";
52+
private static final String PATH = "com/sun/rowset/RowSetResourceBundle";
5353
```
5454
to:
5555
```
@@ -58,15 +58,8 @@ to:
5858

5959
We plan to periodically monitor the OpenJDK source for these files and update this artifact as required.
6060

61-
OpenJDK 14 rowset source:
62-
https://hg.openjdk.java.net/jdk/jdk14/file/6c954123ee8d/src/java.sql.rowset/share/classes/com/sun/rowset
63-
OpenJDK 14 rowset source zip:
64-
https://hg.openjdk.java.net/jdk/jdk14/archive/6c954123ee8d.zip/src/java.sql.rowset/share/classes/com/sun/rowset/
61+
OpenJDK 17 rowset source:
62+
https://github.com/openjdk/jdk/tree/master/src/java.sql.rowset/share/classes/com/sun/rowset
6563

66-
***2020-12-11: These files do not appear to have any changes for OpenJDK 15:***
67-
https://hg.openjdk.java.net/jdk/jdk15/file/tip/src/java.sql.rowset/share/classes/com/sun/rowset/
68-
https://hg.openjdk.java.net/jdk/jdk15/log/0dabbdfd97e6/src/java.sql.rowset/share/classes/com/sun/rowset/JdbcRowSetImpl.java
69-
https://hg.openjdk.java.net/jdk/jdk15/log/0dabbdfd97e6/src/java.sql.rowset/share/classes/com/sun/rowset/JdbcRowSetResourceBundle.java
70-
71-
This code is released under the GNU General Public License, version 2,with the Classpath Exception:
72-
https://openjdk.java.net/legal/gplv2+ce.html
64+
This code is released under the GNU General Public License, version 2, with the Classpath Exception:
65+
https://github.com/openjdk/jdk/blob/72a976ef05fc2c62657920a560a0abc60b27c852/LICENSE

pom.xml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@
2020
<version.maven>3.6.3</version.maven>
2121
<version.java>1.8</version.java>
2222

23-
<version.maven-enforcer-plugin>3.0.0-M3</version.maven-enforcer-plugin>
23+
<version.maven-enforcer-plugin>3.0.0</version.maven-enforcer-plugin>
2424
<version.maven-compiler-plugin>3.8.1</version.maven-compiler-plugin>
25+
<version.dependency-check-maven>6.4.1</version.dependency-check-maven>
2526
<version.maven-source-plugin>3.2.1</version.maven-source-plugin>
26-
<version.maven-javadoc-plugin>3.2.0</version.maven-javadoc-plugin>
27-
<version.maven-gpg-plugin>1.6</version.maven-gpg-plugin>
27+
<version.maven-javadoc-plugin>3.3.1</version.maven-javadoc-plugin>
28+
<version.maven-gpg-plugin>3.0.1</version.maven-gpg-plugin>
2829
<version.nexus-staging-maven-plugin>1.6.8</version.nexus-staging-maven-plugin>
2930
</properties>
3031

@@ -117,6 +118,29 @@
117118
</build>
118119

119120
<profiles>
121+
122+
<profile>
123+
<!-- invoked during verify phase -->
124+
<!-- https://jeremylong.github.io/DependencyCheck/dependency-check-maven/ -->
125+
<id>owasp-check</id>
126+
<build>
127+
<plugins>
128+
<plugin>
129+
<groupId>org.owasp</groupId>
130+
<artifactId>dependency-check-maven</artifactId>
131+
<version>${version.dependency-check-maven}</version>
132+
<executions>
133+
<execution>
134+
<id>attach-sources</id>
135+
<goals>
136+
<goal>check</goal>
137+
</goals>
138+
</execution>
139+
</executions>
140+
</plugin>
141+
</plugins>
142+
</build>
143+
</profile>
120144

121145
<profile>
122146
<id>release</id>

src/main/java/com/nqadmin/rowset/JdbcRowSetImpl.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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
@@ -45,13 +45,15 @@
4545
*
4646
* @author Jonathan Bruce, Amit Handa
4747
*/
48+
4849
public 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

Comments
 (0)