jdbc で mysql サーバーの特定のスキーマに接続しようとしています。スキーマ名はマイニングです
接続しようとすると、すべてのDBにアクセスできるため、実行中のステートメントは、「マイニング」だけではなく、DB内のすべてのスキームに適用されます
これは私が接続を確立する方法です:
public class Mining {
Connection conn;
void createConnection() {
try {
Class.forName("com.mysql.jdbc.Driver");
this.conn = DriverManager.getConnection(
"jdbc:mysql://localhost/?currentSchema=mining","admin","admin" );
//I ALSO TRIED THIS: "jdbc:mysql://localhost/mining","admin","admin"
} catch (SQLException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
何かご意見は?
ありがとう!