Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Loading...
User Settings
close menu
Welcome to Scribd!
Upload
Read for free
FAQ and support
Language (EN)
Sign in
0 ratings
0% found this document useful (0 votes)
3 views
C
Uploaded by
IRON MAN
AI-enhanced
C
Copyright:
© All Rights Reserved
Available Formats
Download
as PDF, TXT or read online from Scribd
Download
Save
Save c For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
C
Uploaded by
IRON MAN
0 ratings
0% found this document useful (0 votes)
3 views
2 pages
AI-enhanced title
Document Information
click to expand document information
C
Original Title
c
Copyright
© © All Rights Reserved
Available Formats
PDF, TXT or read online from Scribd
Share this document
Share or Embed Document
Sharing Options
Share on Facebook, opens a new window
Facebook
Share on Twitter, opens a new window
Twitter
Share on LinkedIn, opens a new window
LinkedIn
Share with Email, opens mail client
Email
Copy link
Copy link
Did you find this document useful?
0%
0% found this document useful, Mark this document as useful
0%
0% found this document not useful, Mark this document as not useful
Is this content inappropriate?
Report
C
Copyright:
© All Rights Reserved
Available Formats
Download
as PDF, TXT or read online from Scribd
Download now
Download as pdf or txt
Save
Save c For Later
0 ratings
0% found this document useful (0 votes)
3 views
2 pages
C
Uploaded by
IRON MAN
AI-enhanced title
C
Copyright:
© All Rights Reserved
Available Formats
Download
as PDF, TXT or read online from Scribd
Save
Save c For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download as pdf or txt
Jump to Page
You are on page 1
of 2
Search inside document
Number:"); lbl2.setBounds(20, 50, 100, 10); name='Hari',address='Ktm' WHERE sid='1'"; import java.io.
*; public class MyTest {
jframe.add(lbl2); JTextField txt2=new JTextField(); st.execute(sql2); System.out.println("\nData public static void main(String[] args) {
txt2.setBounds(120, 50, 120, 20); jframe.add(txt2); Updated Successfully"); try { FileWriter writer = new
JLabel lbl3=new JLabel("Result: "); FileWriter("MyFile.txt", true);
//lbl3.setText("Result: "); //deleting data String sql3="DELETE FROM student writer.write("Hello World");
WHERE sid='2'"; st.execute(sql3); writer.write("\r\n"); // write new line
lbl3.setBounds(20,80,100,30); jframe.add(lbl3); System.out.println("Data Deleted Successfully\n"); writer.write("Good Bye!");
JButton btn=new JButton("Calculate"); //retrieving data System.out.println("Data After writer.close(); } catch (IOException e) {
btn.setBounds(100, 120, 100, 30); Update and Delete"); String sql5="SELECT * FROM e.printStackTrace(); } } }
jframe.add(btn); btn.addActionListener(new student"; ResultSet rs1=st.executeQuery(sql5); Serialization Interface Serializable is a
ActionListener() { public void System.out.println("Sid\t"+"Name\t"+"address\t" marker interface (has no data member
actionPerformed(ActionEvent ae) { String +"Contact"); while(rs1.next()) { String and method). It is used to "mark" Java
first1=txt1.getText().toString(); String sid=rs1.getString(1); String name=rs1.getString(2); classes so that objects of these classes
second1=txt2.getText().toString(); int a,b,c; String address=rs1.getString(3); String may get the certain capability. The
a=Integer.parseInt(first1); contact=rs1.getString(4); Cloneable and Remote are also marker
b=Integer.parseInt(second1); c=a+b; System.out.println(sid+"\t"+name+"\t"+address+" interfaces.
lbl3.setText("Result: "+c); \t"+contact); } }catch(Exception e) { Serialization Example import java.io.*;
//JOptionPane.showMessageDialog(null, System.out.println(e); } } } class Studentinfo implements
"Addition= "+c); } }); } public static void Serializable { String name; int rid; static
main(String[] args) { Example Program – Program to add two Numbers
String contact; Studentinfo(String n, int
SwingUtilities.invokeLater(new Runnable() { public import java.applet.*; import java.awt.*; import
r, String c) { this.name = n; this.rid = r;
void run() { new SwingDemo(); } }); } } java.awt.event.*; public class Applet2 extends
impot java.swing.*; this.contact = c; } } public class MyTest {
Applet { public void init() { Label lbl1=new
public static void main(String[] args) {
import java.sql.*; public class DB_Test { public Label("First Number: "); add(lbl1); TextField
import java.awt.event.*; try { Studentinfo si = new
static void main(String[] args) { try { txt1=new TextField(10); add(txt1); Label lbl2=new
Studentinfo("Abhi", 104, "110044");
public class KeyListenerExample extends Frame Class.forName("com.mysql.jdbc.Driver"); Label("Second Number: "); add(lbl2); TextField
FileOutputStream fos = new
implements KeyListener{ Label l; TextArea area; Connection conn=DriverManager.getConnection txt2=new TextField(10);
FileOutputStream("student.ser");
KeyListenerExample(){ l=new Label(); ("jdbc:mysql://localhost:3306/bca","root","");
add(txt2); Label lbl3=new Label("Result: "); ObjectOutputStream oos = new
l.setBounds(20,50,100,20); area=new TextArea(); //database="", username=root and password=""
add(lbl3); Button btn=new Button("Submit"); ObjectOutputStream(fos);
area.setBounds(20,80,300, 300); System.out.println("Database connected");
add(btn); btn.addActionListener(new oos.writeObject(si); oos.close();
area.addKeyListener(this); add(l);add(area); Statement st=conn.createStatement(); //clearing
ActionListener() { public void fos.close(); } catch (Exception e) {
setSize(400,400); setLayout(null); setVisible(true); data String sql="DELETE FROM student";
actionPerformed(ActionEvent ae) { int e.printStackTrace(); } } } Object of
} public void keyPressed(KeyEvent e) { st.execute(sql); //inserting data String
first=Integer.parseInt (txt1.getText().toString()); int Studentinfo class is serialized using
l.setText("Key Pressed"); } public void sql1="INSERT INTO
second=Integer.parseInt (txt2.getText().toString()); writeObject() method and written to
keyReleased(KeyEvent e) { l.setText("Key student(sid,name,address,contact) VALUES
int res=first+second; lbl3.setText("Result: "+res); } student.ser file. Deserialization
Released"); } public void keyTyped(KeyEvent e) { ('1','Raaju','Btm','9862612723'),
}); } } Example import java.io * ; class
l.setText("Key Typed"); } public static void ('2','Ram','Ktm','8811111111')"; st.execute(sql1);
DeserializationTest { public static void
main(String[] args) { new KeyListenerExample(); } } System.out.println("Data Inserted
1. Reading a File import java.io.*; public main(String[] args) { studentinfo si=null
Successfully\n"); //retrieving data
class MyTest { public static void ; try { FileInputStream fis = new
import javax.swing.*; import java.awt.event.*; System.out.println("Data Before Update and
main(String[] args) { try { FileReader FileInputStream("student.ser");
public class SwingDemo { SwingDemo(){ JFrame Delete"); String sql4="SELECT * FROM student";
reader = new FileReader("MyFile.txt"); ObjectOutputStream ois = new
jframe=new JFrame("This is a simple JFrame ResultSet rs=st.executeQuery(sql4);
BufferedReader bufferedReader = new ObjectOutputStream(fis); si =
App"); jframe.setSize(400, 300); System.out.println("Sid\t"+"Name\t"+"address\t"
BufferedReader(reader); String line; (studentinfo)ois.readObject(); }
jframe.setLocationRelativeTo(null); +"Contact"); while(rs.next()) { String
while ((line = catch (Exception e) {
jframe.getContentPane().setLayout(null); sid=rs.getString(1); String name=rs.getString(2);
bufferedReader.readLine()) != null) { e.printStackTrace(); }
jframe.setVisible(true); JLabel lbl1=new String address=rs.getString(3); String
System.out.println(line); } System.out.println(si.name);
JLabel("First Number:"); lbl1.setBounds(20, 10, contact=rs.getString(4);
reader.close(); } catch (IOException e) { System.out. println(si.rid);
100, 10); jframe.add(lbl1); JTextField txt1=new System.out.println(sid+"\t"+name+"\t"+address+"
e.printStackTrace(); } } } System.out.println(si.contact); } }
JTextField(); txt1.setBounds(120, 10, 120, 20); \t"+contact); } //updating data String
2. . Writing to a File
jframe.add(txt1); JLabel lbl2=new JLabel("Second sql2="UPDATE student SET
You might also like
Dell EMC Unity XT Hardware Concepts and Features-SSP - Participant Guide
Document
98 pages
Dell EMC Unity XT Hardware Concepts and Features-SSP - Participant Guide
Ladislau
100% (1)
Java Lab2
Document
8 pages
Java Lab2
Dsp Chowdary
No ratings yet
Krishna Os Practical
Document
57 pages
Krishna Os Practical
Kirti Rajbhar
No ratings yet
A Dvace Oop Lab Report Solved 5 4th Cs
Document
4 pages
A Dvace Oop Lab Report Solved 5 4th Cs
Hamza Ramay
No ratings yet
Java Slip Solutions
Document
30 pages
Java Slip Solutions
AbdulBasit Shaikh
No ratings yet
Collections Linkedlist List Hashtest String Hashtest String: Import Java Import Java Import Java Public Class
Document
27 pages
Collections Linkedlist List Hashtest String Hashtest String: Import Java Import Java Import Java Public Class
khardemegha
0% (1)
Object Oriented Programming Using Java Lab
Document
14 pages
Object Oriented Programming Using Java Lab
Srinu Shahu
No ratings yet
Adrijeet Deb 17bci0185 Cse1007 - Java Programming - L33+L34 Lab Assessment 3 Question No: 1
Document
18 pages
Adrijeet Deb 17bci0185 Cse1007 - Java Programming - L33+L34 Lab Assessment 3 Question No: 1
PRATHAM SHARMA 20BCE2463
No ratings yet
Note Taking
Document
3 pages
Note Taking
Manu yadav
No ratings yet
EX: NO. 1 Rational Number Class in Java Date
Document
28 pages
EX: NO. 1 Rational Number Class in Java Date
Vanitha Mani
No ratings yet
Java Lab Codings
Document
15 pages
Java Lab Codings
Babu
No ratings yet
Java All
Document
91 pages
Java All
Shreya Jagtap
No ratings yet
1) // Program To Find The Harmonic Series Up To A Given Range
Document
23 pages
1) // Program To Find The Harmonic Series Up To A Given Range
Sadhi Kumar
No ratings yet
Core Java Material 2
Document
199 pages
Core Java Material 2
raamsgoluguri
No ratings yet
Prac Pgms
Document
21 pages
Prac Pgms
yugabharath852
No ratings yet
Delegates C#
Document
6 pages
Delegates C#
01fe18bcs028
No ratings yet
java apr2023 pdf
Document
9 pages
java apr2023 pdf
gauravborkar262
No ratings yet
Java Program
Document
50 pages
Java Program
prathmeshkatkar57
No ratings yet
Java Lab Programs
Document
20 pages
Java Lab Programs
kirthisarala
No ratings yet
TYBCA VI Slip Solution
Document
7 pages
TYBCA VI Slip Solution
SOHAIL PATHAN2
No ratings yet
JDBC Programs P-1: Package Import Public Class Public Static Void Throws Null Null Try
Document
17 pages
JDBC Programs P-1: Package Import Public Class Public Static Void Throws Null Null Try
nivya inventateq
No ratings yet
Java
Document
14 pages
Java
GANESH REDDY
No ratings yet
JAVA Tip
Document
114 pages
JAVA Tip
Aqeel Bashir
No ratings yet
Mini Project
Document
13 pages
Mini Project
Kaarthik Raja
No ratings yet
Java Bit
Document
1 page
Java Bit
Adithya menon
No ratings yet
Advance Java Programming Code
Document
40 pages
Advance Java Programming Code
Harsha Vardhan
No ratings yet
Test-1 Solutions
Document
11 pages
Test-1 Solutions
D Nitesh Kumar
No ratings yet
Code Java
Document
11 pages
Code Java
Văn Huyy
No ratings yet
Java Program Solved Manual
Document
13 pages
Java Program Solved Manual
mohammad.rashid2181
No ratings yet
Lab Sheet - Module 1 - Record - Writing
Document
9 pages
Lab Sheet - Module 1 - Record - Writing
Sherry Kalkeri
No ratings yet
Core Java Practical Questions
Document
17 pages
Core Java Practical Questions
omyaa122
No ratings yet
Ex - No.11 Mini-Project AIM
Document
13 pages
Ex - No.11 Mini-Project AIM
Kaarthik Raja
No ratings yet
Slip1
Document
6 pages
Slip1
Virat Kohli
No ratings yet
Java Lab8 20BCE1794 Shreya
Document
12 pages
Java Lab8 20BCE1794 Shreya
SHREYA SIVAKUMAR 20BCE1794
No ratings yet
Practical Program Slip
Document
18 pages
Practical Program Slip
komal rajendra Khamkar
No ratings yet
Java Programming - Unit 2
Document
41 pages
Java Programming - Unit 2
Anonymous sMqylH
No ratings yet
Programs 042734
Document
8 pages
Programs 042734
aadityasalgaonkar
No ratings yet
23ID01CE020 ( Practical - 5 )
Document
9 pages
23ID01CE020 ( Practical - 5 )
Puru Jangid
No ratings yet
Insertion
Document
7 pages
Insertion
Noor Saba
No ratings yet
QQQW
Document
11 pages
QQQW
Anmol Sharma
No ratings yet
Practical Exam
Document
13 pages
Practical Exam
Isha Narvekar
No ratings yet
Ilovepdf Merged
Document
25 pages
Ilovepdf Merged
itssecretblogger
No ratings yet
Final
Document
63 pages
Final
noel portillo
No ratings yet
9919004002(event handling)
Document
33 pages
9919004002(event handling)
Kamatchi Kartheeban
No ratings yet
Ajp Ans
Document
23 pages
Ajp Ans
vaishnavipaste55
No ratings yet
Page No. 65 (Write)
Document
6 pages
Page No. 65 (Write)
Kiran Rajput
No ratings yet
Employee Processing - Using Class
Document
38 pages
Employee Processing - Using Class
Pavithra
No ratings yet
Android
Document
9 pages
Android
Minh Bảo Vũ
No ratings yet
4.packages in Java-2
Document
14 pages
4.packages in Java-2
amoldivate0077
No ratings yet
Oopm Pro
Document
26 pages
Oopm Pro
pproject345
No ratings yet
21BCM075 Csi0403 Assignment 4
Document
10 pages
21BCM075 Csi0403 Assignment 4
Chirag Saraf
No ratings yet
Class Gen (Private T Object Public Gen (T Object) (This - Object Object ) Public T Getobject (Return Object )
Document
25 pages
Class Gen (Private T Object Public Gen (T Object) (This - Object Object ) Public T Getobject (Return Object )
Supratik Chatterjee
No ratings yet
Java Manual R-22
Document
35 pages
Java Manual R-22
my stories
No ratings yet
Java Programming: Lab Assessment - 5
Document
45 pages
Java Programming: Lab Assessment - 5
Varanasi Mounika
No ratings yet
PR 18
Document
4 pages
PR 18
shreyaslokhande361
No ratings yet
AJPractical 1 Aryan
Document
9 pages
AJPractical 1 Aryan
a240304
No ratings yet
Laprak Modul 10
Document
18 pages
Laprak Modul 10
Rizqy Alfajri
No ratings yet
Lab Task 3
Document
15 pages
Lab Task 3
thirdparty546
No ratings yet
Multi Threading, Frame and EH
Document
31 pages
Multi Threading, Frame and EH
Muskan singh
No ratings yet
Javascript Assessment Test
From Everand
Javascript Assessment Test
Edward Yao
No ratings yet
Java Programming Tutorial With Screen Shots & Many Code Example
From Everand
Java Programming Tutorial With Screen Shots & Many Code Example
Desmond Ohwofosirai
No ratings yet
HQ Samnan Riyadh: Mobily 5 MB Internet Conection
Document
1 page
HQ Samnan Riyadh: Mobily 5 MB Internet Conection
Khuram Khan
No ratings yet
Keshav Synopsis Format
Document
6 pages
Keshav Synopsis Format
Kaustubh Mongia
No ratings yet
AJP - PR22 - 68 - B - Abhishek Hagawane
Document
17 pages
AJP - PR22 - 68 - B - Abhishek Hagawane
Abhishek Hagawane
No ratings yet
UNIT 1 - Program Logic Development
Document
36 pages
UNIT 1 - Program Logic Development
Dwaranath Srinivasan
No ratings yet
Manual Leitor Zebra ds2208
Document
399 pages
Manual Leitor Zebra ds2208
Francis Pinheiro
No ratings yet
Inspection Software For Lathes
Document
90 pages
Inspection Software For Lathes
elumb
100% (1)
MC9S08SE8RM
Document
236 pages
MC9S08SE8RM
Horacio Gamaliel Peña Diaz
No ratings yet
Practice Practical 5
Document
5 pages
Practice Practical 5
parmar shyam
100% (1)
Mobile Networking For Smart Dust: J.M. Kahn, R.H. Katz and K.S.J. Pister
Document
21 pages
Mobile Networking For Smart Dust: J.M. Kahn, R.H. Katz and K.S.J. Pister
Su Sushma
No ratings yet
Survey Questionnaire
Document
2 pages
Survey Questionnaire
catherine furio
No ratings yet
Semaphores
Document
5 pages
Semaphores
Vijay.N
No ratings yet
Download: You Can A Businessobjects Report With Examples of Several of These Formulas
Document
3 pages
Download: You Can A Businessobjects Report With Examples of Several of These Formulas
satya.patna
No ratings yet
Fy21 First Call NS Redwood
Document
53 pages
Fy21 First Call NS Redwood
BáThành
No ratings yet
Abstractions 21st Nicholson
Document
10 pages
Abstractions 21st Nicholson
Zan Usi
No ratings yet
Pspice Simulink Matlab Datasheet
Document
3 pages
Pspice Simulink Matlab Datasheet
ak-n
100% (1)
How To Install Ubuntu in Oracle VM VirtualBox
Document
30 pages
How To Install Ubuntu in Oracle VM VirtualBox
Keshav
100% (3)
Sriteja Lanka Resume
Document
5 pages
Sriteja Lanka Resume
Masum Patthak
No ratings yet
Dhi Itc237 Pw1b Irz Datasheet 20170401
Document
2 pages
Dhi Itc237 Pw1b Irz Datasheet 20170401
Jonathan Piñeres
No ratings yet
Hyperdrive ReFill Documentation
Document
4 pages
Hyperdrive ReFill Documentation
rusty
No ratings yet
PM Prep Session 3
Document
18 pages
PM Prep Session 3
R K DIVYA SRI
No ratings yet
CA Customizing For The Archive Link Document Finder
Document
71 pages
CA Customizing For The Archive Link Document Finder
bharat
100% (1)
Attachments (2/2) To Solving A 3x3 Rubik's Cube With A Flexpicker / Delta Robot
Document
335 pages
Attachments (2/2) To Solving A 3x3 Rubik's Cube With A Flexpicker / Delta Robot
Pieter Depamelaere
No ratings yet
Reflective Journal
Document
27 pages
Reflective Journal
Sheldon Cardoza
0% (1)
NECDT33012DENG Desktop Digital Terminals LR
Document
2 pages
NECDT33012DENG Desktop Digital Terminals LR
cpumpy
No ratings yet
SMS Alarm System For Weather Station Using Arduino and GSM Module
Document
5 pages
SMS Alarm System For Weather Station Using Arduino and GSM Module
Editor IJTSRD
No ratings yet
JMAG Basic Training: Get Started With JMAG Designer
Document
4 pages
JMAG Basic Training: Get Started With JMAG Designer
xabiferreras
No ratings yet
Data Analysis With Python, SQL &
Document
18 pages
Data Analysis With Python, SQL &
ronitgupta547
No ratings yet
TL DR: Eric Zimmerman's Tools
Document
5 pages
TL DR: Eric Zimmerman's Tools
bob jones
No ratings yet
December Remote Tech Jobs - Career Resources
Document
26 pages
December Remote Tech Jobs - Career Resources
Anant Pandey
No ratings yet