im trying to connect to the database and thier is an error in the createstatemnet thats is "incompatab le types required is java.beans.Stat emnet and found java.sql.Statem ent "
any one can help me in this error
thanx .
any one can help me in this error
thanx .
Code:
static Connection connection;
static Statement statement;
public static void SetupConn(){
try {
// Step 1: Load the JDBC driver.
Class.forName("org.hsqldb.jdbcDriver");
System.out.println("Driver Loaded.");
// Step 2: Establish the connection to the database.
String url = "jdbc:hsqldb:data/tutorial";
connection = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl", "scott", "tiger");
System.out.println("Got Connection.");
statement = connection.createStatement();
} catch ( ClassNotFoundException | SQLException e) {
System.err.println("Got an exception! ");
System.exit(0);
}
}
}
Comment