please how fix this error thanks a lot error: package oracle.jdbc.driver does not exist.
tell me how the package install on my PC
for my following code :
import java.sql.*;
import java.sql.Statement;
public class ConnectOracle {
public static void main(String[] args) {
try {
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
System.out.println("Connecting to the database...");
Connection connection = DriverManager.getConnection(
"jdbc:oracle:thin:@localhost:1521:orcl", "system", "123");
Statement statement = connection.createStatement();
ResultSet resultset = statement.executeQuery("select 'Connected' from dual");
resultset.next();
String s = resultset.getString(1);
System.out.println(s);
statement.close();
connection.close();
} catch (Exception e) {
System.out.println("The exception raised is:" + e);
}
}
}
please give me some code to insert and delete (how execute ?!).Thanks .