Skip to content

Commit

Permalink
Properly implemented class fix
Browse files Browse the repository at this point in the history
  • Loading branch information
isaac-mcfadyen committed Jul 5, 2022
1 parent b90f9b1 commit 65a88f3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/org/isaacmcfadyen/D1ResultSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public boolean wasNull() throws SQLException {

@Override
public String getString(int columnIndex) throws SQLException {
if (rows.get(currentRow - 1).get(columnIndex - 1).getClass() != JSONObject.NULL) {
if (!JSONObject.NULL.equals(rows.get(currentRow - 1).get(columnIndex - 1))) {
return (String) rows.get(currentRow - 1).get(columnIndex - 1);
} else {
return null;
Expand All @@ -81,7 +81,7 @@ public short getShort(int columnIndex) throws SQLException {

@Override
public int getInt(int columnIndex) throws SQLException {
if (rows.get(currentRow - 1).get(columnIndex - 1).getClass() != JSONObject.NULL) {
if (!JSONObject.NULL.equals(rows.get(currentRow - 1).get(columnIndex - 1))) {
return (int) rows.get(currentRow - 1).get(columnIndex - 1);
} else {
return 0;
Expand All @@ -100,7 +100,7 @@ public float getFloat(int columnIndex) throws SQLException {

@Override
public double getDouble(int columnIndex) throws SQLException {
if (rows.get(currentRow - 1).get(columnIndex - 1).getClass() != JSONObject.NULL) {
if (!JSONObject.NULL.equals(rows.get(currentRow - 1).get(columnIndex - 1))) {
return (double) rows.get(currentRow - 1).get(columnIndex - 1);
} else {
return 0;
Expand Down Expand Up @@ -149,7 +149,7 @@ public InputStream getBinaryStream(int columnIndex) throws SQLException {

@Override
public String getString(String columnLabel) throws SQLException {
if (rows.get(currentRow - 1).get(columnNames.indexOf(columnLabel)).getClass() != JSONObject.NULL) {
if (!JSONObject.NULL.equals(rows.get(currentRow - 1).get(columnNames.indexOf(columnLabel)))) {
return (String) rows.get(currentRow - 1).get(columnNames.indexOf(columnLabel));
} else {
return null;
Expand All @@ -173,7 +173,7 @@ public short getShort(String columnLabel) throws SQLException {

@Override
public int getInt(String columnLabel) throws SQLException {
if (rows.get(currentRow - 1).get(columnNames.indexOf(columnLabel)).getClass() != JSONObject.NULL) {
if (!JSONObject.NULL.equals(rows.get(currentRow - 1).get(columnNames.indexOf(columnLabel)))) {
return (int) rows.get(currentRow - 1).get(columnNames.indexOf(columnLabel));
} else {
return 0;
Expand All @@ -192,7 +192,7 @@ public float getFloat(String columnLabel) throws SQLException {

@Override
public double getDouble(String columnLabel) throws SQLException {
if(rows.get(currentRow - 1).get(columnNames.indexOf(columnLabel)).getClass() != JSONObject.NULL) {
if (!JSONObject.NULL.equals(rows.get(currentRow - 1).get(columnNames.indexOf(columnLabel)))) {
return (double) rows.get(currentRow - 1).get(columnNames.indexOf(columnLabel));
} else {
return 0;
Expand Down

0 comments on commit 65a88f3

Please sign in to comment.