import java.sql.*;
class CallableStmt
{
public static void main(String[] args) throws Exception
{
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","system");
CallableStatement pstmt=con.prepareCall("{call proc(?,?)}");
pstmt.setInt(1,10);
pstmt.setString(2,"arun");
pstmt.execute();
System.out.println("insert record is with Prepare Statement......");
con.close();
System.out.println("connection is closed");
}
}
No comments:
Post a Comment