hi
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user