Skip to content

Commit fec7f59

Browse files
committed
fix: library updated.
1 parent e2d70f3 commit fec7f59

4 files changed

Lines changed: 9 additions & 20 deletions

File tree

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ plugins {
1414
}
1515

1616
compileJava {
17-
sourceCompatibility = '11'
18-
targetCompatibility = '11'
17+
sourceCompatibility = '1.8'
18+
targetCompatibility = '1.8'
1919
}
2020

2121
repositories {

src/main/java/com/code/advancedsql/query/ExecuteQuery.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,10 @@ public Map<String, Object> fetch() throws SQLException {
3939

4040
Map<String, Object> map = new HashMap<>();
4141

42-
for (int i = 0; i < metaData.getColumnCount(); i++) {
43-
try {
42+
try {
43+
for (int i = 1; i <= metaData.getColumnCount(); i++)
4444
map.put(metaData.getColumnName(i), resultSet.getObject(i));
45-
} catch (SQLException ignored) {}
46-
}
45+
} catch (SQLException ignored) {}
4746

4847
resultSet.close();
4948
prepare.close();

src/main/java/com/code/advancedsql/query/Query.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@ public ResultSet executeQuery() throws SQLException {
4646

4747
ISQL.setStatementParameters(this.prepare, this.execute);
4848

49-
ResultSet resultSet = prepare.executeQuery();
50-
51-
prepare.close();
52-
53-
return resultSet;
49+
return prepare.executeQuery();
5450
}
5551

5652
public int executeUpdate() throws SQLException {

src/main/java/com/code/advancedsql/query/join/Join.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,9 @@ public Select getQuery() {
133133

134134
@Override
135135
public String toQuery() {
136-
StringBuilder query = new StringBuilder(this.getPrefix() + " " + this.table);
137-
138-
query.append(this.as != null ? " AS " + this.as : "");
139-
140-
query.append(this.on != null ? " ON (" + this.on + ")" : "");
141-
142-
query.append(this.using != null ? " USING (" + String.join(", ", this.using) + ")" : " ");
143-
144-
return query.toString();
136+
return this.getPrefix() + " " + this.table + (this.as != null ? " AS " + this.as : "") +
137+
(this.on != null ? " ON (" + this.on + ")" : "") +
138+
(this.using != null ? " USING (" + String.join(", ", this.using) + ")" : " ");
145139
}
146140

147141
@Override

0 commit comments

Comments
 (0)