Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.*;
- public class InsertUsers {
- public InsertUsers() {
- }
- public static void main(String args[]) {
- String url = "jdbc:oracle:thin:@localhost:1521:xe";
- Connection con;
- Statement stmt;
- String query = "select COF_NAME, PRICE from COFFEES";
- try {
- Class.forName("oracle.jdbc.driver.OracleDriver");
- } catch(java.lang.ClassNotFoundException e) {
- System.err.print("ClassNotFoundException: ");
- System.err.println(e.getMessage());
- }
- try {
- con = DriverManager.getConnection(url,"system","4rfv5tgb&YHN");
- con.close();
- } catch(SQLException ex) {
- System.err.println("SQLException: " + ex.getMessage());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement