-
Notifications
You must be signed in to change notification settings - Fork 0
/
WEEK11_2
27 lines (26 loc) · 965 Bytes
/
WEEK11_2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import java.sql.*;
import java.lang.*;
public class UpdateData {
public static void main(String args[]) {
try {
Connection conn = null;
Statement stmt = null;
String DB_URL = "jdbc:sqlite:/tempfs/db";
System.setProperty("org.sqlite.tmpdir", "/tempfs");
String query="";
// Open a connection
conn = DriverManager.getConnection(DB_URL);
stmt = conn.createStatement();
String sql = "UPDATE PLAYERS " +
"SET Age = 24 WHERE UID == 1";
stmt.executeUpdate(sql);
String sql1 = "UPDATE PLAYERS " +
"SET Last_Name = 'Gopala' WHERE UID == 1";
stmt.executeUpdate(sql1);
String sql2 = "UPDATE PLAYERS " +
"SET First_Name = 'Rama' WHERE UID == 1";
stmt.executeUpdate(sql2);
}
catch(Exception e){ System.out.println(e);}
}
}