Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package batchddemo;
- import java.sql.*;
- /**
- *
- * @author admin
- */
- public class BatchDdemo {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- // TODO code application logic here
- try {
- Class.forName("oracle.jdbc.driver.OracleDriver");
- Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE", "system", "system");
- System.out.println("database connected...");
- Statement stmt=con.createStatement();
- // stmt.execute("create table t3(name varchar2(10),rollno number(6))");
- // System.out.println("Table created...");
- stmt.executeUpdate("insert into t3 values('ss',12)");
- System.out.println("data inserted...");
- } catch (ClassNotFoundException | SQLException e) {
- System.out.println(e);
- }
- }
- }
Add Comment
Please, Sign In to add comment