hello everyone,
can any one tell me following:
1) Is it possible to connect greenfoot game with database.
2) if possible please give me the code.
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import data.QuestionNaire;
public class dbConnection {
Connection connection;
String dbName;
String tableName;
public dbConnection(String dbUrl, String userName, String password, String driver/*, String dbName*/) throws Exception {
//this.dbName = dbName;
System.out.println("starting connection");
Class.forName(driver);
System.out.println("driver loaded");
connection = DriverManager.getConnection(dbUrl, userName, password);
}
public void finalize() {
try {
shutdown();
}
catch (SQLException se) {
se.printStackTrace();
}
}
}