❮ Previous Next ❯

Statement Interface In JDBC

Let's see a program to insert a row using Statement interface:

import java.sql.*;
class JdbcInsertDemo
{
public static void main(String args[]) throws SQLException,ClassNotFoundException
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","system","password");
Statement st=conn.createStatement();
String s="insert into employee values(102,'Tapaswini',30000)";
int i=st.executeUpdate(s);
System.out.println(i+"row is inserted");
conn.close();
}
}
Output
1 row is inserted
❮ Previous Next ❯

Follow Us




  Tutorials

Popular Links

Contact Us

address Plot No-741,2ND Floor
Opp. Bhagabati Temple,Jayadev Vihar
      Bhubaneswar-751013
      Email: info@silantechnology.com
      Phone: 0674-2361252
address
39877, sundale dr, apt#101, Fremont, California 94538, USA
       Phone: +1(262)388-7619

facebook twitter google linked in

© 2018 Silan Technology. All Rights Reserved