Professional Documents
Culture Documents
===================================================================
faq:
i
define ResultSet?
thi
=>ResultSet is an interface from java.sql package.
ipa
ResultSet-Interface
Ma
=>This ResultSet-Object will hold the result generated from select
queries.
syntax:
sh
ResultSet rs = stm.executeQuery("select-queries");
ate
===================================================================
=
Ex-program:
nk
Program : DBCon2.java
package test;
import java.util.*;
import java.sql.*;
i
Scanner s = new Scanner(System.in);
thi
try(s;){
try {
ipa
System.out.println("Enter the CustId:");
Ma String cId = s.nextLine();
("jdbc:oracle:thin:@localhost:1521:xe",
"system","manager");
i
Statement stm = con.createStatement();
thi
int k = stm.executeUpdate
ipa
values('"+cId+"','"+cName+"','"+city+"','"+state+"',"+pinCode+",'"+mId+"',"+phN
o+")");
Ma if(k>0) {
con.close();
}catch(Exception e) {e.printStackTrace();}
nk
}//end of try-with-resource
Ve
o/p:
Alex
Hyd
i
Enter the CustState:
thi
TS
ipa
65432
Ma
Enter the CustMailId:
a@gmail.com
===================================================================
==
nk
Assignment:
Ve
===================================================================
===
Ve
nk
ate
sh
Ma
ipa
thi
i