You are on page 1of 42

Chat Log      C:\Users\chira\Documents\ChatLog Refresher Program _Java Full stack

_ C Programming _ Python_ _Batch1_ Virtual Training at NEC 2021_10_14 12_32.rtf

Chirag Yadav (to Nagareddy Deepthi): 08:59: Hey, are you from banglore?
Chirag Yadav (to Nagareddy Deepthi): 09:03: i want to know how expensive banglore
is? means i got a location of banglore so approx how much would be monthly cost?
please tell if u have some idea
Chirag Yadav (to Vijeta Vinod Savant): 09:06: Hey, are you from banglore?

Vijeta Vinod Savant (Private): 09:06: yes


Chirag Yadav (to Vijeta Vinod Savant): 09:07: i want to know how expensive banglore
is? means i got a location of banglore so approx how much would be monthly cost?
please tell if u have some idea

Chirag Yadav (to Vijeta Vinod Savant): 09:08: actually i am from delhi ncr so i have no
ideas
Chirag Yadav (to Vijeta Vinod Savant): 09:08: idea*
Vijeta Vinod Savant (Private): 09:09: 10k to 12k
Chirag Yadav (to Vijeta Vinod Savant): 09:10: what are the P.G charges there?
Vijeta Vinod Savant (Private): 09:13: from 6k to 9k most of them maximum 11k for
double sharing depends on location also. I stay in clg hostel its 9k.
Chirag Yadav (to Vijeta Vinod Savant): 09:15: oh
Chirag Yadav (to Vijeta Vinod Savant): 09:15: thank you bro.
Vijeta Vinod Savant (Private): 09:15: np
Akshay Singh (to Everyone): 09:16: Id    Name      Age
101    Emp1    30
102    Emp2    35
APURV AGNIHOTRI (to Everyone): 09:16: mam attendence
Vijeta Vinod Savant (to Everyone): 09:17: Id    Name      Age
101    Emp1    30
102    Emp2    35
Shipra Yadav (to Everyone): 09:17: Id    Name      Age
101    Emp1    30
102    Emp2    35
Abhishek Rana (to Everyone): 09:18: Id    Name    address      city    state    zip_code
234    abhi    aa    abcd    awer    wer   

Nagareddy Deepthi (Private): 09:21: yes chirag i am from bangalore


Nagareddy Deepthi (Private): 09:22: when talking about expenses it depends on the
person like how much comfort he wants..
Chirag Yadav (to Organizer(s) Only): 09:23: present mam
Chirag Yadav (to Organizer(s) Only): 09:23: mam actually i was also present yesterday
Chirag Yadav (to Organizer(s) Only): 09:24: yes mam executing
Chirag Yadav (to Organizer(s) Only): 09:24: mic problem
Nagareddy Deepthi (Private): 09:24: In general approx to 10k per month for living
without extra expenses..
Chirag Yadav (to Nagareddy Deepthi): 09:25: in 10k what food and living?
Nagareddy Deepthi (Private): 09:26: yeah i mean for pg
Chirag Yadav (to Nagareddy Deepthi): 09:26: oh
Nagareddy Deepthi (Private): 09:26: where are u frm?
Chirag Yadav (to Nagareddy Deepthi): 09:26: can u please suggest me any location
near NEC company where i could find pg easily and in budget too.
Chirag Yadav (to Nagareddy Deepthi): 09:27: i am from Delhi ncr.
Nagareddy Deepthi (Private): 09:28: Actually at prsent i am staying in college
hostel..even i want to check that i can let you know once i check
Nagareddy Deepthi (Private): 09:29: when do u want to shift?
Saumya Vishwakarma (to Everyone): 09:29: Hello
Saumya Vishwakarma (to Everyone): 09:35: Connected with MySQL successfully

Saumya Vishwakarma (to Everyone): 09:35: Ma'am Now resolved


Chirag Yadav (to Nagareddy Deepthi): 09:36: thank you soo much Deepthi.
Chirag Yadav (to Nagareddy Deepthi): 09:37: I will shift in Jan, most probably.
Nagareddy Deepthi (Private): 09:38: ohh u will be done with clg by jan?
Nagareddy Deepthi (Private): 09:39: okay i will let u know like by end of nov mostly
Chirag Yadav (to Nagareddy Deepthi): 09:39: no, my college will finish in June 2022,
Nagareddy Deepthi (Private): 09:39: then?
Chirag Yadav (to Nagareddy Deepthi): 09:40: can i get ur whatsapp or insta account,
to contact you directly whenever needed?
Harshit Mimani (to Everyone): 09:40: Id      Name      Age
101    Emp1    30
102    Emp2    35

Nagareddy Deepthi (Private): 09:40: 9100588866 is my whatsapp no


Monica (to Everyone): 09:40: tea break 20 min
Chirag Yadav (to Nagareddy Deepthi): 09:41: ok
Chirag Yadav (to Nagareddy Deepthi): 09:42: actually, college will finish in june, but i
will relocate to banglore in Jan. We just have to go for external exams only
Nagareddy Deepthi (Private): 09:43: ohh nice..text me in whatsapp
Chirag Yadav (to Nagareddy Deepthi): 09:44: ya sure.
Saumya Vishwakarma (to Everyone): 09:45: Id    Name      Age
101    Emp1    30
102    Emp2    35

shivendra gupta (to Everyone): 09:46: mam on installing xampp it is showing a


dialouge box with some error
Monica (to Everyone): 09:59: create database javadb;  
use javadb;  
create table emp(id int, name varchar(40), age int);   
Insert into emp values(101, 'Emp1', 30);
Insert into emp values(102, 'Emp2', 35);

Monica (to Everyone): 09:59: create database javadb;  

Monica (to Everyone): 10:00: create table emp(id int, name varchar(40), age int);   

Monica (to Everyone): 10:00: Insert into emp values(101, 'Emp1', 30);
Insert into emp values(102, 'Emp2', 35);

Monica (to Everyone): 10:00: CREATE TABLE users (


user_id int NOT NULL AUTO_INCREMENT,
username varchar(45) NOT NULL,
password varchar(45) NOT NULL,
fullname varchar(45) NOT NULL,
email varchar(45) NOT NULL,
PRIMARY KEY (user_id)
);

Monica (to Everyone): 10:01: import java.sql.*;


public class Main1 {
public static void main(String args[]) {
try {
Class.forName("com.mysql.jdbc.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/javadb", "root", "");
System.out.println("Connected with MySQL successfully");
con.close();
} catch (Exception e) {
System.out.println(e);
}
} }
Saumya Vishwakarma (to Everyone): 10:01: Back
Chirag Yadav (to Nagareddy Deepthi): 10:01: back
Harshit Mimani (to Everyone): 10:01: Back
Deep Shikhar Singh (to Everyone): 10:01: back
Ravi Pratap (to Everyone): 10:01: Back
Piyush Shukla (to Everyone): 10:01: Back
Apurv Agnihotri (to Everyone): 10:01: Back
Unnati (to Everyone): 10:01: back
Shivaksh Ahalawat (to Everyone): 10:01: back
Shipra Yadav (to Everyone): 10:01: Back
K Prasanna Kumar (to Everyone): 10:01: Back
Chirag Yadav (to Everyone): 10:01: back
Atul Gupta (to Everyone): 10:01: back
Nagareddy Deepthi (to Everyone): 10:01: back
shivendra gupta (to Everyone): 10:01: Connected with MySQL successfully

AMAN SAXENA (to Everyone): 10:02: back


Vijeta Vinod Savant (to Everyone): 10:02: back
Challa Bhavya (to Everyone): 10:02: back
Monica (to Everyone): 10:02: import java.sql.*;
public class MysqlConRead {
public static void main(String args[]) {
try {
Class.forName("com.mysql.jdbc.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/javadb", "root", "");
//here javadb is database name, root is username and password   
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from emp");
while (rs.next())
System.out.println(rs.getInt(1) + "    " + rs.getString(2) + "    "
+ rs.getString(3));
con.close();
} catch (Exception e) {
System.out.println(e);
}
} }

Shivaksh Ahalawat (to Everyone): 10:03: Id    Name      Age


101    Emp1    30
102    Emp2    35

shivendra gupta (to Everyone): 10:03: 101    Emp1    30


102    Emp2    35

Monica (to Everyone): 10:05: Download and Paste the mysqlconnector.jar file in
jre/lib/ext folder from
http://www.java2s.com/Code/Jar/m/Downloadmysqlconnectorjar.htm
Set classpath of environment or eclipse project.

Unnati (to Everyone): 10:06: mam before that we saved our jar file in java folder
Monica (to Everyone): 10:09: import java.sql.*;

public class MysqlCon1 {


public static void main(String args[]) {
try {
Class.forName("com.mysql.jdbc.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/javadb", "root", "");
Statement stmt = con.createStatement();
int s = stmt.executeUpdate("insert into emp
values(104,'HarryPotter',18)");
System.out.println(s + " Records inserted");
con.close();
} catch (Exception e) {
System.out.println(e);
}
}
}

shivendra gupta (to Everyone): 10:09: 1 Records inserted

AMAN SAXENA (to Everyone): 10:10: 1 Records inserted

Deep Shikhar Singh (to Everyone): 10:10: 1 Records inserted


Piyush Shukla (to Everyone): 10:10: 1 Records inserted

Shipra Yadav (to Everyone): 10:10: 1 Records inserted


Naveen Kumar Mittal (to Everyone): 10:10: 1 Records inserted

K Prasanna Kumar (to Everyone): 10:10: 1 Records inserted


Shikhar Shukla (to Everyone): 10:10: 1 Records inserted
Kushagra Gupta (to Everyone): 10:10: 1 Records inserted
Saumya Vishwakarma (to Everyone): 10:10: 1 Records inserted

Ravi Pratap (to Everyone): 10:10: 1 Records inserted


Harthik Ps (to Everyone): 10:10: 1 Records inserted

Shivaksh Ahalawat (to Everyone): 10:10: 1 Records inserted

Harshit Mimani (to Everyone): 10:10: 1 Records inserted

Akshay Singh (to Everyone): 10:10: 1 Records inserted


Atul Gupta (to Everyone): 10:10: 1 Records inserted

Akshay Singh (to Everyone): 10:11: Id    Name      Age


101    Emp1    30
102    Emp2    35
104    HarryPotter    18
Kushagra Gupta (to Everyone): 10:11: Id    Name      Age
101    Emp1    30
102    Emp2    35
104    HarryPotter    18
shivendra gupta (to Everyone): 10:11:
id
name
age
101
Emp1
30
102
Emp2
35
104
HarryPotter
18

Abhishek Rana (to Everyone): 10:11: 1 Records inserted


Harthik Ps (to Everyone): 10:11: Id      Name      Age
101    Emp1    30
102    Emp2    35
104    HarryPotter    18

Nagareddy Deepthi (to Everyone): 10:11: 1 Records inserted


shivendra gupta (to Everyone): 10:11: 101    Emp1    30
102    Emp2    35
104    HarryPotter    18

Saumya Vishwakarma (to Everyone): 10:12: Id    Name      Age


101    Emp1    30
102    Emp2    35
104    HarryPotter    18

Shivaksh Ahalawat (to Everyone): 10:12: Id    Name      Age


101    Emp1    30
102    Emp2    35
104    HarryPotter    18
Shikhar Shukla (to Everyone): 10:12: Id    Name      Age
101    Emp1    30
102    Emp2    35
104    HarryPotter    18
AMAN SAXENA (to Everyone): 10:12: Id    Name      Age
101    Emp1    30
102    Emp2    35
104    HarryPotter    18
Naveen Kumar Mittal (to Everyone): 10:12: id
name
age
101
Emp1
30
102
Emp2
35
104
HarryPotter
18
Piyush Shukla (to Everyone): 10:12: Id    Name      Age
101    Emp1    30
102    Emp2    35
104    HarryPotter    18

Deep Shikhar Singh (to Everyone): 10:12: Id    Name      Age


101    Emp1    30
102    Emp2    35
104    HarryPotter    18

Abhishek Rana (to Everyone): 10:12: 127.0.0.1/javadb/emp/


http://localhost/phpmyadmin/index.php?route=/database/sql&db=javadb

      Showing rows 0 -    2 (3 total, Query took 0.0006 seconds.)

select * from emp;

id name age
101 Emp1 30
102 Emp2 35
104 HarryPotter 18

Atul Gupta (to Everyone): 10:12:


id
name
age
101
Emp1
30
102
Emp2
35
104
HarryPotter
18
K Prasanna Kumar (to Everyone): 10:13: Id    Name      Age
101    Emp1    30
102    Emp2    35
103    HarryPotter    21
Monica (to Everyone): 10:13: import java.sql.*;

public class MysqlCon1 {


public static void main(String args[]) {
try {
Class.forName("com.mysql.jdbc.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/javadb", "root", "");
Statement stmt = con.createStatement();
int s = stmt.executeUpdate("insert into emp
values(105,'Harmoine',17),(106,'Ronie',18);");
System.out.println(s + " Records inserted");
con.close();
} catch (Exception e) {
System.out.println(e);
}
}
Harthik Ps (to Everyone): 10:13: 2 Records inserted

Akshay Singh (to Everyone): 10:14: 2 Records inserted

Harthik Ps (to Everyone): 10:14: Id      Name      Age


101    Emp1    30
102    Emp2    35
104    HarryPotter    18
105    Hermoine    17
106    Ron    18

Atul Gupta (to Everyone): 10:14: 2 Records inserted

Deep Shikhar Singh (to Everyone): 10:14: 2 Records inserted


Naveen Kumar Mittal (to Everyone): 10:14: 2 Records inserted

Akshay Singh (to Everyone): 10:14: Id    Name      Age


101    Emp1    30
102    Emp2    35
104    HarryPotter    18
105    Harmoine    17
106    Ronie    18
Piyush Shukla (to Everyone): 10:14: 2 Records inserted

Harshit Mimani (to Everyone): 10:14: 2 Records inserted


shivendra gupta (to Everyone): 10:14: 101    Emp1    30
102    Emp2    35
104    HarryPotter    18
105    Harmoine    17
106    Ronie    18

K Prasanna Kumar (to Everyone): 10:14: Id    Name      Age


101    Emp1    30
102    Emp2    35
103    HarryPotter    21
105    Harmoine    17
106    Ronie    18

Atul Gupta (to Everyone): 10:14: 127.0.0.1/javadb/emp/

http://localhost/phpmyadmin/index.php?route=/table/sql&db=javadb&table=emp

      Showing rows 0 -    4 (5 total, Query took 0.0015 seconds.)

SELECT * FROM emp;

id name age
101 Emp1 30
102 Emp2 35
104 HarryPotter 18
105 Harmoine 17
106 Ronie 18

Nagareddy Deepthi (to Everyone): 10:14: 2 Records inserted


Shivaksh Ahalawat (to Everyone): 10:14: 2 Records inserted
Saumya Vishwakarma (to Everyone): 10:14: 2 Records inserted

Ravi Pratap (to Everyone): 10:14: 101    Emp1    30


102    Emp2    35
104    HarryPotter    18
105    Harmoine    17
106    Ronie    18

Naveen Kumar Mittal (to Everyone): 10:14: id


name
age
101
Emp1
30
102
Emp2
35
104
HarryPotter
18
105
Harmoine
17
106
Ronie
18

Harshit Mimani (to Everyone): 10:14: id


name
age
101
Emp1
30
102
Emp2
35
104
HarryPotter
18
104
HarryPotter
18
105
Harmoine
17
106
Ronie
18

Saumya Vishwakarma (to Everyone): 10:15: Id    Name      Age


101    Emp1    30
102    Emp2    35
104    HarryPotter    18
105    Harmoine    17
106    Ronie    18

Shikhar Shukla (to Everyone): 10:15: Id    Name      Age


101    Emp1    30
102    Emp2    35
104    HarryPotter    18
105    Harmoine    17
106    Ronie    18

AMAN SAXENA (to Everyone): 10:15: 2 Records inserted


Kushagra Gupta (to Everyone): 10:15: Id    Name      Age
101    Emp1    30
102    Emp2    35
104    HarryPotter    18
105    Harmoine    17
106    Ronie    18
Piyush Shukla (to Everyone): 10:15: Id    Name      Age
101    Emp1    30
102    Emp2    35
104    HarryPotter    18
105    Harmoine    17
106    Ronie    18
AMAN SAXENA (to Everyone): 10:15: Id    Name      Age
101    Emp1    30
102    Emp2    35
104    HarryPotter    18
105    Harmoine    17
106    Ronie    18
Deep Shikhar Singh (to Everyone): 10:15: id name age
101 Emp1 30
102 Emp2 35
104 HarryPotter 18
105 Harmoine 17
106 Ronie 18

Shipra Yadav (to Everyone): 10:15: Id    Name      Age


101    Emp1    30
102    Emp2    35
104    HarryPotter    18
105    Harmoine    17
106    Ronie    18
Shivaksh Ahalawat (to Everyone): 10:16: Id    Name      Age
101    Emp1    30
102    Emp2    35
104    HarryPotter    18
105    Harmoine    17
106    Ronie    18

Shipra Yadav (to Everyone): 10:16: 2 Records inserted


Harthik Ps (to Everyone): 10:17: 3 Records updated

Monica (to Everyone): 10:17: import java.sql.*;

public class MysqlCon2 {


public static void main(String args[]) {
try {
Class.forName("com.mysql.jdbc.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/javadb", "root", "");
Statement stmt = con.createStatement();
int s = stmt.executeUpdate("Update emp set age=age+6 where
id>104");
System.out.println(s + " Records updated");
con.close();
} catch (Exception e) {
System.out.println(e);
}
}
}

Harthik Ps (to Everyone): 10:17: Id      Name      Age


101    Emp1    30
102    Emp2    35
104    HarryPotter    24
105    Hermoine    23
106    Ron    24

AMAN SAXENA (to Everyone): 10:17: 3 Records updated

AMAN SAXENA (to Everyone): 10:18: Id    Name      Age


101    Emp1    30
102    Emp2    35
104    HarryPotter    24
105    Harmoine    23
106    Ronie    24
Akshay Singh (to Everyone): 10:18: 3 Records updated

Kushagra Gupta (to Everyone): 10:18: 3 Records updated


Akshay Singh (to Everyone): 10:18: Id    Name      Age
101    Emp1    30
102    Emp2    35
104    HarryPotter    24
105    Harmoine    23
106    Ronie    24

Shipra Yadav (to Everyone): 10:18: Id    Name      Age


101    Emp1    30
102    Emp2    35
104    HarryPotter    24
105    Harmoine    23
106    Ronie    24
Kushagra Gupta (to Everyone): 10:18: Id    Name      Age
101    Emp1    30
102    Emp2    35
104    HarryPotter    24
105    Harmoine    29
106    Ronie    30

Deep Shikhar Singh (to Everyone): 10:18: 3 Records updated


shivendra gupta (to Everyone): 10:18: 3 Records updated
K Prasanna Kumar (to Everyone): 10:18: Id    Name      Age
101    Emp1    30
102    Emp2    35
103    HarryPotter    21
105    Harmoine    29
106    Ronie    30

Shikhar Shukla (to Everyone): 10:18: Id    Name      Age


101    Emp1    30
102    Emp2    35
104    HarryPotter    30
105    Harmoine    29
106    Ronie    30

Atul Gupta (to Everyone): 10:19:

id name age
101 Emp1 30
102 Emp2 35
104 HarryPotter 24
105 Harmoine 23
106 Ronie 24

shivendra gupta (to Everyone): 10:19: 101    Emp1    30


102    Emp2    35
104    HarryPotter    24
105    Harmoine    29
106    Ronie    30
105    Harmoine    29
106    Ronie    30

Unnati (to Everyone): 10:19: Id    Name      Age


101    Emp1    30
102    Emp2    35
104    HarryPotter    18
104    HarryPotter    18
105    Harmoine    23
106    Ronie    24

Naveen Kumar Mittal (to Everyone): 10:19: Id    Name      Age


101    Emp1    30
102    Emp2    35
104    HarryPotter    24
105    Harmoine    29
106    Ronie    30

Shivaksh Ahalawat (to Everyone): 10:19: 3 Records updated


Shivaksh Ahalawat (to Everyone): 10:19: Id    Name      Age
101    Emp1    30
102    Emp2    35
104    HarryPotter    24
105    Harmoine    29
106    Ronie    30
Piyush Shukla (to Everyone): 10:19: Id    Name      Age
101    Emp1    30
102    Emp2    35
104    HarryPotter    30
105    Harmoine    29
106    Ronie    30
Monica (to Everyone): 10:19: import java.sql.*;

public class MysqlCon3 {


public static void main(String args[]) {
try {
Class.forName("com.mysql.jdbc.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/javadb", "root", "");
Statement stmt = con.createStatement();
int s = stmt.executeUpdate("Delete from emp where id=104");
System.out.println(s + " Records deleted");
con.close();
} catch (Exception e) {
System.out.println(e);
}
}
}
Deep Shikhar Singh (to Everyone): 10:19: id      name age
101 Emp1 30
102 Emp2 35
104 HarryPotter 24
105 Harmoine 29
106 Ronie 30

AMAN SAXENA (to Everyone): 10:20: 1 Records deleted

AMAN SAXENA (to Everyone): 10:20: Id    Name      Age


101    Emp1    30
102    Emp2    35
105    Harmoine    23
106    Ronie    24

shivendra gupta (to Everyone): 10:20: 1 Records deleted

Kushagra Gupta (to Everyone): 10:20: 1 Records deleted


Shipra Yadav (to Everyone): 10:20: 1 Records deleted

Deep Shikhar Singh (to Everyone): 10:20: 1 Records deleted


Kushagra Gupta (to Everyone): 10:20: Id    Name      Age
101    Emp1    30
102    Emp2    35
105    Harmoine    23
106    Ronie    24

Harthik Ps (to Everyone): 10:20: 1 Records deleted

Shipra Yadav (to Everyone): 10:20: Id    Name      Age


101    Emp1    30
102    Emp2    35
105    Harmoine    23
106    Ronie    24

Abhishek Rana (to Everyone): 10:20:


id name age
101 Emp1 30
102 Emp2 35
105 Harmoine 23
106 Ronie 24

Shikhar Shukla (to Everyone): 10:20: Id    Name      Age


101    Emp1    30
102    Emp2    35
105    Harmoine    29
106    Ronie    30

Harthik Ps (to Everyone): 10:20: Id      Name      Age


101    Emp1    30
102    Emp2    35
105    Hermoine    23
106    Ron    24

Shivaksh Ahalawat (to Everyone): 10:21: 1 Records deleted


Piyush Shukla (to Everyone): 10:21: 1 Records deleted

Nagareddy Deepthi (to Everyone): 10:21: 1 Records deleted


Naveen Kumar Mittal (to Everyone): 10:21: Id    Name      Age
101    Emp1    30
102    Emp2    35
105    Harmoine    29
106    Ronie    30

Vijeta Vinod Savant (to Everyone): 10:21: 1 Records deleted


Saumya Vishwakarma (to Everyone): 10:21: 1 Records deleted
Unnati (to Everyone): 10:21: Id    Name      Age
101    Emp1    30
102    Emp2    35
105    Harmoine    23
106    Ronie    24

Akshay Singh (to Everyone): 10:21: Id    Name      Age


101    Emp1    30
102    Emp2    35
105    Harmoine    23
106    Ronie    24
Saumya Vishwakarma (to Everyone): 10:22: Id    Name      Age
101    Emp1    30
102    Emp2    35
105    Harmoine    23
106    Ronie    24
Atul Gupta (to Everyone): 10:22: id name age
101 Emp1 30
102 Emp2 35
105 Harmoine 23
106 Ronie 24

Deep Shikhar Singh (to Everyone): 10:22: id      name age


101 Emp1 30
102 Emp2 35
105 Harmoine 29
106 Ronie 30

K Prasanna Kumar (to Everyone): 10:22: Id    Name      Age


101    Emp1    30
102    Emp2    35
105    Harmoine    29
106    Ronie    30

Akshay Singh (to Everyone): 10:23: Id    Name      Age


101    Emp1    30
102    Emp2    35
105    Harmoine    23
106    Ronie    24

Harshit Mimani (to Everyone): 10:23: Id      Name      Age


101    Emp1    30
102    Emp2    35
105    Harmoine    29
106    Ronie    30
Monica (to Everyone): 10:28: import java.sql.*;

public class JdbcInsertDemo {


public static void main(String[] args) {
try {
Class.forName("com.mysql.jdbc.Driver");
Connection conn =
DriverManager.getConnection("jdbc:mysql://localhost:3306/javadb", "root", "");
String sql = "INSERT INTO Users (username, password, fullname,
email) "
+ "VALUES (?, ?, ?, ?)";
PreparedStatement statement = conn.prepareStatement(sql);
statement.setString(1, "bill");
statement.setString(2, "secretpass");
statement.setString(3, "Bill Gates");
statement.setString(4, "bill.gates@microsoft.com");
int rowsInserted = statement.executeUpdate();
if (rowsInserted > 0) {
System.out.println("A new user was inserted successfully!");
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
}

shivendra gupta (to Everyone): 10:29: A new user was inserted successfully!

AMAN SAXENA (to Everyone): 10:29: A new user was inserted successfully!
Deep Shikhar Singh (to Everyone): 10:29: A new user was inserted successfully!
Saumya Vishwakarma (to Everyone): 10:29: A new user was inserted successfully!

K Prasanna Kumar (to Everyone): 10:30: A new user was inserted successfully!

Abhishek Rana (to Everyone): 10:30: A new user was inserted successfully!

Atul Gupta (to Everyone): 10:30: A new user was inserted successfully!

Vijeta Vinod Savant (to Everyone): 10:30: A new user was inserted successfully!
shivendra gupta (to Everyone): 10:31: 1 bill secretpass Bill Gates
bill.gates@microsoft.com

Piyush Shukla (to Everyone): 10:31: A new user was inserted successfully!

Harthik Ps (to Everyone): 10:31: A new user was inserted successfully!

Shivaksh Ahalawat (to Everyone): 10:31: A new user was inserted successfully!
Syed Ali Abbas (to Everyone): 10:31: A new user was inserted successfully!
Naveen Kumar Mittal (to Everyone): 10:31: A new user was inserted successfully!

Mohit Rai (to Everyone): 10:32: A new user was inserted successfully!
Shipra Yadav (to Everyone): 10:32: A new user was inserted
successfully!

Abhishek Rana (to Everyone): 10:32: 1


bill
secretpass
Bill Gates
bill.gates@microsoft.com

Akshay Singh (to Everyone): 10:35: A new user was inserted successfully!
Nagareddy Deepthi (to Everyone): 10:36: A new user was inserted successfully!
Naveen Kumar Mittal (to Everyone): 10:40: user_id    username password fullname   
email
1    bill    secretpass    Bill Gates    bill.gates@microsoft.com
Harshit Mimani (to Everyone): 10:40: userId    password fullname        email
1 bill secretpass    Bill Gates
Harthik Ps (to Everyone): 10:40: Id      UserName      Password      Fullname      Email
1        bill        secretpass        Bill Gates        bill.gates@microsoft.com

Unnati (to Everyone): 10:41: Id    Name      Password    fullnames    Emails


1    bill    secretpass Bill Gates bill.gates@microsoft.com
2    bill    secretpass Bill Gates bill.gates@microsoft.com

Monica (to Everyone): 10:42: import java.sql.*;


public class JdbcInsertDemo {
public static void main(String[] args) {
String dbURL = "jdbc:mysql://localhost:3306/javadb";
try {
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection(dbURL, "root",
"");
String sql = "DELETE FROM Users WHERE username=?";
                         PreparedStatement statement = conn.prepareStatement(sql);
                statement.setString(1, "bill");
                int rowsDeleted = statement.executeUpdate();
                if (rowsDeleted > 0) {
              System.out.println("A user was deleted successfully!");
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
}

Naveen Kumar Mittal (to Everyone): 10:44: user_id    username password fullname   
email

Harthik Ps (to Everyone): 10:44: A user was deleted successfully!

Piyush Shukla (to Everyone): 10:44: A user was deleted successfully!

Atul Gupta (to Everyone): 10:44: A user was deleted successfully!

Abhishek Rana (to Everyone): 10:44: A user was deleted successfully!


Vijeta Vinod Savant (to Everyone): 10:45: A user was deleted successfully!
Shikhar Shukla (to Everyone): 10:45: A user was deleted successfully!
Shivaksh Ahalawat (to Everyone): 10:45: A user was deleted successfully!
Syed Ali Abbas (to Everyone): 10:45: A user was deleted successfully!

Deep Shikhar Singh (to Everyone): 10:45: A user was deleted successfully!
Piyush Shukla (to Everyone): 10:45: A new user was inserted successfully!

Akshay Singh (to Everyone): 10:45: A user was deleted successfully!


Saumya Vishwakarma (to Everyone): 10:45: A user was deleted successfully!
Akshay Singh (to Everyone): 10:45: A new user was inserted successfully!

shivendra gupta (to Everyone): 10:45: A user was deleted successfully!

Challa Bhavya (to Everyone): 10:46: A user was deleted successfully!


AMAN SAXENA (to Everyone): 10:46: A user was deleted successfully!
Unnati (to Everyone): 10:49: A new user was inserted successfully!

Monica (to Everyone): 10:50: import java.sql.*;


public class JdbcInsertDemo {
public static void main(String[] args) {
String dbURL = "jdbc:mysql://localhost:3306/javadb";
try {
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection(dbURL, "root",
"");
String sql = "UPDATE Users SET password=?, fullname=?, email=?
WHERE username=?";
PreparedStatement statement = conn.prepareStatement(sql);
statement.setString(1, "123456789");
statement.setString(2, "William Henry Bill Gates");
statement.setString(3, "bill@gatesfoundation.org");
statement.setString(4, "bill");
int rowsUpdated = statement.executeUpdate();
if (rowsUpdated > 0) {
System.out.println("An existing user was updated
successfully!"); }
} catch (Exception ex) {
ex.printStackTrace(); }
} }

Akshay Singh (to Everyone): 10:51: An existing user was updated successfully!
K Prasanna Kumar (to Everyone): 10:51: An existing user was updated successfully!
AMAN SAXENA (to Everyone): 10:51: An existing user was updated successfully!

Atul Gupta (to Everyone): 10:51: bill


123456789
William Henry Bill Gates
bill@gatesfoundation.org
Akshay Singh (to Everyone): 10:51: user_id username password fullname email
1 bill 123456789 William Henry Bill Gates bill@gatesfoundation.org

Kushagra Gupta (to Everyone): 10:51: An existing user was updated successfully!
Kushagra Gupta (to Everyone): 10:51: bill123456789William Henry Bill
Gatesbill@gatesfoundation.org
Deep Shikhar Singh (to Everyone): 10:52: An existing user was updated successfully!
Harthik Ps (to Everyone): 10:52: Id      UserName      Password      Fullname      Email
2        bill        123456789        William Henry Bill Gates        bill@gatesfoundation.org

Unnati (to Everyone): 10:52: An existing user was updated successfully!

shivendra gupta (to Everyone): 10:52: An existing user was updated successfully!
Unnati (to Everyone): 10:52: Id    Name      Password    fullnames    Emails
3    bill    123456789 William Henry Bill Gates bill@gatesfoundation.org

Piyush Shukla (to Everyone): 10:52: An existing user was updated successfully!

Naveen Kumar Mittal (to Everyone): 10:52: user_id    username password fullname   
email
4    bill    123456789    William Henry Bill Gates    bill@gatesfoundation.org

Saumya Vishwakarma (to Everyone): 10:52: An existing user was updated successfully!

Saumya Vishwakarma (to Everyone): 10:53: username    password    fullname    email


3    bill    123456789 William Henry Bill Gates

Monica (to Everyone): 10:55: Create a database Publisher with Table: Author(author id,
name, phone, address, city, state, and zip )
Enter some data through hypothetical Forms in Java submitted by Authors through SQL
insert queries
Create a Menu driven Java Application to Add, Edit, Delete, and Select data from the
table
Create another application to retrieve information (author id, name, phone, address, city,
state, and zip ) about the authors who are living in the city    where the city name begins
with the letter “S”.

Unnati (to Everyone): 11:30: mam please repeat it


Monica (to Everyone): 11:32: –ea
Monica (to Everyone): 11:32: –enableassertions
Monica (to Everyone): 11:37: package AssertionExample;

public class AssertionEg {

public static void main(String[] args) {

                int value = 21;


                assert value >= 20 : " Underweight";
                System.out.println("value is "+value);

}
}

Monica (to Everyone): 11:37: package AssertionExample;

public class AssertionEg {

public static void main(String[] args) {

                int value = 15;


                assert value >= 20 : " Underweight";
                System.out.println("value is "+value);

Kushagra Gupta (to Everyone): 11:37: Exception in thread "main"


java.lang.AssertionError: UnderWeight
at AssertionExample.AssertionEg.main(AssertionEg.java:7)
Akshay Singh (to Everyone): 11:37: Exception in thread "main" java.lang.AssertionError:
Underweight
at AssertionExample.AssertionEg.main(AssertionEg.java:5)
Atul Gupta (to Everyone): 11:37: Exception in thread "main" java.lang.AssertionError:
Underweight
at AssertionExample.AssertionEg.main(AssertionEg.java:7)

Harthik Ps (to Everyone): 11:37: Exception in thread "main" java.lang.AssertionError:   


Underweight
at AssertionExample.AssertionEg.main(AssertionEg.java:7)

Kushagra Gupta (to Everyone): 11:38: Value is 21


shivendra gupta (to Everyone): 11:38: value is 21

Deep Shikhar Singh (to Everyone): 11:38: value is 15


Harthik Ps (to Everyone): 11:38: value is 21

Kushagra Gupta (to Everyone): 11:38: Value is 15


Piyush Shukla (to Everyone): 11:38: value is 15

Unnati (to Everyone): 11:38: value is 21


Naveen Kumar Mittal (to Everyone): 11:38: value is 21

Akshay Singh (to Everyone): 11:38: value is 15

shivendra gupta (to Everyone): 11:38: value is 15

AMAN SAXENA (to Everyone): 11:38: value is 15

Akshay Singh (to Everyone): 11:38: value is 21


Vijeta Vinod Savant (to Everyone): 11:38: value is 15

K Prasanna Kumar (to Everyone): 11:38: Value = 10


Shivaksh Ahalawat (to Everyone): 11:38: Exception in thread "main"
java.lang.AssertionError:    Underweight
at AssertionExample.AssertionEg.main(AssertionEg.java:8)

Ravi Pratap (to Everyone): 11:39: Exception in thread "main" java.lang.AssertionError:   


Underweight
at AssertionExample.AssertionEg.main(AssertionEg.java:7)

Shivaksh Ahalawat (to Everyone): 11:39: value is 15

K Prasanna Kumar (to Everyone): 11:39: Exception in thread "main"


java.lang.AssertionError: Uderweight
at AssertionExample.AssertionEg.main(AssertionEg.java:7)
Saumya Vishwakarma (to Everyone): 11:39: value is 21

Unnati (to Everyone): 11:39: Exception in thread "main" java.lang.AssertionError:   


Underweight
at Assertionexample.AssertionEg.main(AssertionEg.java:10)

Naveen Kumar Mittal (to Everyone): 11:39: Exception in thread "main"


java.lang.AssertionError:    Underweight
at AssertionExample.AssertionEg.main(AssertionEg.java:8)

Piyush Shukla (to Everyone): 11:39: Exception in thread "main"


java.lang.AssertionError:    Underweight
at assertionExample.AssertionEg.main(AssertionEg.java:8)
Deep Shikhar Singh (to Everyone): 11:40: Exception in thread "main"
java.lang.AssertionError:    Underweight
at AssertionExample.AssertionEg.main(AssertionEg.java:7)
Monica (to Everyone): 11:50: package ManualTesting;

public class Main {


// @BeforeClass
static {
System.out.println("Before class Main");
}

public static void main(String[] a) {


testsquare();// manual unit testing
}

static int square(int x) {


return x * x;
}

static int cube(int x) {


return x * x * x;
}

// @test
static void testsquare() { // unit test functions: test cases
fn();
int aa = 10;
if (square(aa) == 110) {
System.out.println("Test succedded");
} else
System.out.println("Test failed");
fna();
}

// @test
static void testcube() {
// unit test functions: test cases
fn();
int aa = 10;
if (cube(aa) == 1000) {
System.out.println("Test succedded");
} else
System.out.println("Test failed");
fna();
}

// @Before
static void fn() {
System.out.println("before Test cases ");
}

// @after
static void fna() {
System.out.println("After Test cases ");
}
}

Naveen Kumar Mittal (to Everyone): 11:51: Before class Main


before Test cases
Test failed
After Test cases

Saumya Vishwakarma (to Everyone): 11:51: Before class Main


before Test cases
Test failed
After Test cases

shivendra gupta (to Everyone): 11:51: Before class Main


before Test cases
Test failed
After Test cases

Syed Ali Abbas (to Everyone): 11:51: Before class Main


before Test cases
Test failed
After Test cases

Vijeta Vinod Savant (to Everyone): 11:51: Before class Main


before Test cases
Test failed
After Test cases
Atul Gupta (to Everyone): 11:51: Before class Main
before Test cases
Test failed
After Test cases

Kushagra Gupta (to Everyone): 11:51: Before class Main


before Test cases
Test failed
After Test cases
Akshay Singh (to Everyone): 11:51: Before class Main
before Test cases
Test failed
After Test cases
AMAN SAXENA (to Everyone): 11:52: Before class Main
before Test cases
Test failed
After Test cases

Kushagra Gupta (to Everyone): 11:52: Before class Main


before Test cases
Test succedded
After Test cases
Harthik Ps (to Everyone): 11:52: Before class Main
before Test cases
Test failed
After Test cases
before Test cases
Test succedded
After Test cases

Unnati (to Everyone): 11:52: Before class Main


before Test cases
Test failed
After Test cases

Monica (to Everyone): 11:52: package ManualTesting;

public class Main {


// @BeforeClass
static {
System.out.println("Before class Main");
}

public static void main(String[] a) {


testsquare();// manual unit testing
testcube();
}

static int square(int x) {


return x * x;
}

static int cube(int x) {


return x * x * x;
}

// @test
static void testsquare() { // unit test functions: test cases
fn();
int aa = 10;
if (square(aa) == 110) {
System.out.println("Test succedded");
} else
Deep Shikhar Singh (to Everyone): 11:52: Before class Main
before Test cases
Test failed
After Test cases
Monica (to Everyone): 11:52: package ManualTesting;

public class Main {


// @BeforeClass
static {
System.out.println("Before class Main");
}

public static void main(String[] a) {


testsquare();
testcube();
}
static int square(int x) {
return x * x;
}

static int cube(int x) {


return x * x * x;
}

// @test
static void testsquare() { // unit test functions: test cases
fn();
int aa = 10;
if (square(aa) == 110) {
System.out.println("Test succedded");
} else
System.out.println("Test failed");
fna();
}

// @test
static void testcube() {
// unit test functions: test cases
fn();
int aa = 10;
if (cube(aa) == 1000) {
System.out.println("Test succedded");
} else
System.out.println("Test failed");
fna();
}

// @Before
static void fn() {
System.out.println("before Test cases ");
}

// @after
static void fna() {
System.out.println("After Test cases ");
}
}

Akshay Singh (to Everyone): 11:52: Before class Main


before Test cases
Test failed
After Test cases
before Test cases
Test succedded
After Test cases

Challa Bhavya (to Everyone): 11:53: Before class Main


before Test cases
Test failed
After Test cases

Shivaksh Ahalawat (to Everyone): 11:53: Before class Main


before Test cases
Test failed
After Test cases
before Test cases
Test succedded
After Test cases

Deep Shikhar Singh (to Everyone): 11:53: Before class Main


before Test cases
Test failed
After Test cases
before Test cases
Test succedded
After Test cases
AMAN SAXENA (to Everyone): 11:53: Before class Main
before Test cases
Test failed
After Test cases
before Test cases
Test succedded
After Test cases

Naveen Kumar Mittal (to Everyone): 11:53: Before class Main


before Test cases
Test failed
After Test cases
before Test cases
Test succedded
After Test cases

shivendra gupta (to Everyone): 11:53: Before class Main


before Test cases
Test failed
After Test cases
before Test cases
Test succedded
After Test cases

Unnati (to Everyone): 11:53: Before class Main


before Test cases
Test failed
After Test cases
before Test cases
Test succedded
After Test cases

ananya giridhar (to Everyone): 11:53: Before class Main


before Test cases
Test failed
After Test cases
before Test cases
Test succedded
After Test cases

Shikhar Shukla (to Everyone): 11:54: Before class Main


before Test cases
Test failed
After Test cases
before Test cases
Test succedded
After Test cases

Syed Ali Abbas (to Everyone): 11:54: Before class Main


before Test cases
Test failed
After Test cases
before Test cases
Test succedded
After Test cases
Atul Gupta (to Everyone): 11:54: Before class Main
before Test cases
Test failed
After Test cases
before Test cases
Test succedded
After Test cases
Saumya Vishwakarma (to Everyone): 11:54: Before class Main
before Test cases
Test failed
After Test cases
before Test cases
Test succedded
After Test cases

Challa Bhavya (to Everyone): 11:54: Before class Main


before Test cases
Test failed
After Test cases
before Test cases
Test succedded
After Test cases

Vijeta Vinod Savant (to Everyone): 11:54: Before class Main


before Test cases
Test failed
After Test cases
before Test cases
Test succedded
After Test cases
Monica (to Everyone): 11:56: The Junit 5.x framework is annotation based, so let's see
the annotations that can be used while writing the test cases.
@Test annotation specifies that method is the test method.
@Test(timeout=1000) annotation specifies that method will be failed if it takes longer
than 1000 milliseconds (1 second).
@BeforeClass annotation specifies that method will be invoked only once, before
starting all the tests.
@Before annotation specifies that method will be invoked before each test.
@After annotation specifies that method will be invoked after each test.
@AfterClass annotation specifies that method will be invoked only once, after finishing
all the tests
Monica (to Everyone): 11:57: The org.junit.Assert class provides methods to assert the
program logic.
Methods of Assert class
void assertEquals(boolean expected,boolean actual): checks that two primitives/objects
are equal. It is overloaded.
void assertTrue(boolean condition): checks that a condition is true.
void assertFalse(boolean condition): checks that a condition is false.
void assertNull(Object obj): checks that object is null.
void assertNotNull(Object obj): checks that object is not null.

Monica (to Everyone): 11:58: Create a Java project : JUnitPrj


Add two packages:
source
tests
Add the class file:
source/MainClass.java

Monica (to Everyone): 12:00: package source;


public class MainClass {
public static int findMax(int arr[]) {
int max = 0;
// int max=arr[0];
for (int i = 1; i < arr.length; i++) {
if (max < arr[i])
max = arr[i];
}
return max;
}
public static int cube(int n) {
return n * n * n;
}
}
Monica (to Everyone): 12:02: package source;
public class MainClass {
public static int findMax(int arr[]) {
int max = arr[0];
// int max=arr[0];
for (int i = 1; i < arr.length; i++) {
if (max < arr[i])
max = arr[i];
}
return max;
}
public static int cube(int n) {
return n * n * n;
}
}

Monica (to Everyone): 12:03: TestLogic


Monica (to Everyone): 12:06: package tests;
import source.*;
import static org.junit.Assert.*;
import org.junit.Test;

public class TestLogic {

@Test
public void test() {
assertEquals(4,MainClass.findMax(new int[]{1,3,4,2}));

shivendra gupta (to Everyone): 12:13: mam from where we can get boot dashboard
shivendra gupta (to Everyone): 12:13: ok mam
Monica (to Everyone): 12:17: package tests;

import static org.junit.Assert.*;


import org.junit.*;
import source.*;
public class TestCases {
@BeforeClass
public static void setUpBeforeClass() throws Exception {
System.out.println("before class");
}

@Before
public void setUp() throws Exception {
System.out.println("before");
}

@Test
public void testFindMax() {
System.out.println("test case find max");
assertEquals(4, MainClass.findMax(new int[] { 1, 3, 4, 2 }));
assertEquals(2, MainClass.findMax(new int[] { -12, -3, -4, 2 }));
}

@Test
public void testCube() {
System.out.println("test case cube");
assertEquals(27, MainClass.cube(3));
}

@After
public void tearDown() throws Exception {
System.out.println("after");
}

@AfterClass
public static void tearDownAfterClass() throws Exception {
System.out.println("after class");
}
}

Akshay Singh (to Everyone): 12:18: before class


before
test case find max
after
before
test case cube
after
after class
Harthik Ps (to Everyone): 12:18: before class
before
test case find max
after
before
test case cube
after
after class

Shikhar Shukla (to Everyone): 12:18: before class


before
test case find max
after
before
test case cube
after
after class

Syed Ali Abbas (to Everyone): 12:18: before class


before
test case find max
after
before
test case cube
after
after class
Vijeta Vinod Savant (to Everyone): 12:18: before class
before
test case find max
after
before
test case cube
after
after class
shivendra gupta (to Everyone): 12:18: before class
before
test case find max
after
before
test case cube
after
after class
Harshit Mimani (to Everyone): 12:18: before class
before
test case find max
after
before
test case cube
after
after class
Kushagra Gupta (to Everyone): 12:18: before class
before
test case find max
after
before
test case cube
after
after class
AMAN SAXENA (to Everyone): 12:18: before class
before
test case find max
after
before
test case cube
after
after class

Naveen Kumar Mittal (to Everyone): 12:18: before class


before
test case find max
after
before
test case cube
after
after class
Challa Bhavya (to Everyone): 12:18: before class
before
test case find max
after
before
test case cube
after
after class

Shivaksh Ahalawat (to Everyone): 12:19: before class


before
test case find max
after
before
test case cube
after
after class

Piyush Shukla (to Everyone): 12:19: before class


before
test case find max
after
before
test case cube
after
after class
Unnati (to Everyone): 12:19: before class
before
test case find max
after
before
test case cube
after
after class

K Prasanna Kumar (to Everyone): 12:19: before class


before
test case find max
after
before
test case cube
after
after class

Akshay Singh (to Everyone): 12:26: done


Harthik Ps (to Everyone): 12:26: Done
shivendra gupta (to Everyone): 12:26: done
Syed Ali Abbas (to Everyone): 12:26: Done
Piyush Shukla (to Everyone): 12:26: Done
Nagareddy Deepthi (to Everyone): 12:26: done
ananya giridhar (to Everyone): 12:26: Done
Naveen Kumar Mittal (to Everyone): 12:26: done
shivendra gupta (to Everyone): 12:26: yes mam
Harshit Mimani (to Everyone): 12:26: Done
Deep Shikhar Singh (to Everyone): 12:26: done
Shikhar Shukla (to Everyone): 12:26: done
Unnati (to Everyone): 12:26: done
Vijeta Vinod Savant (to Everyone): 12:26: done
Kushagra Gupta (to Everyone): 12:27: done

AMAN SAXENA (to Everyone): 12:27: done


Ravi Pratap (to Everyone): 12:27: Done
Saumya Vishwakarma (to Everyone): 12:28: Done
K Prasanna Kumar (to Everyone): 12:28: Done
Harthik Ps (to Everyone): 12:31: Thank you ma'am
AMAN SAXENA (to Everyone): 12:31: Thank you ma'am and happy dusshera to
everyone
shivendra gupta (to Everyone): 12:31: thankyou mam
Akshay Singh (to Everyone): 12:31: Thank you Ma'am and same to you
Naveen Kumar Mittal (to Everyone): 12:31: thank you ma'am and happy navratri and
happy dusshera
Piyush Shukla (to Everyone): 12:31: Thank you Ma'am and same2u Ma'am
Harthik Ps (to Everyone): 12:31: happy dusshera to everyone
Unnati (to Everyone): 12:31: Thanku mam and same to u mam
Kushagra Gupta (to Everyone): 12:31: Thank you ma'am and happy dusshera

Ravi Pratap (to Everyone): 12:31: thank you mam


Deep Shikhar Singh (to Everyone): 12:31: thank you ma'am and same to u
Chirag Yadav (to Everyone): 12:31: sure maam. Thank you.
Saumya Vishwakarma (to Everyone): 12:31: Same to you ma'am
Shikhar Shukla (to Everyone): 12:31: Happy dusshera ma'am
Saumya Vishwakarma (to Everyone): 12:31: Thanku ma'am

You might also like