This commit is contained in:
Gregor_Dutzler
2019-10-11 09:03:14 +02:00
parent 032d3a9b9c
commit fb2b191a73
7 changed files with 88 additions and 79 deletions

View File

@ -52,7 +52,7 @@ Database {
System.out.println(row);
}
} catch(SQLException e) {
} catch (SQLException e) {
}
}
@ -68,7 +68,7 @@ Database {
Vector<Vector<Object>> data = new Vector<>();
while(res.next()) {
while (res.next()) {
Vector<Object> row = new Vector();
for (int i = 1; i <= columnCount; ++i) {
@ -79,7 +79,7 @@ Database {
}
return new DefaultTableModel(data, columnNames);
} catch(SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
}

View File

@ -10,9 +10,9 @@ import java.sql.ResultSet;
import java.sql.SQLException;
public class jdcb {
Connection conn;
Connection conn;
public jdcb(String username, String password,String dbname) {
public jdcb(String username, String password, String dbname) {
Database db = new MySQLConnector(
username,
password,
@ -29,7 +29,6 @@ Connection conn;
}
public ResultSet executeQuery(String sql) {
try {
PreparedStatement stmt = conn.prepareStatement(sql);
return stmt.executeQuery();
@ -39,7 +38,7 @@ Connection conn;
return null;
}
public int executeUpdate(String sql){
public int executeUpdate(String sql) {
try {
PreparedStatement stmt = conn.prepareStatement(sql);