Java PREXM
Java PREXM
");
[Link]()printin(""),
‘Scanned with CamScanner“orm namesYorm” method'ge actions "hitytecahost @80Deepiaprglh->
“h>slect Subjectemt>
“robe clase owrak extends Hitpsorvtet
ii void dowattipseritRequest req, HIlServetRenpone resp) throws Serdetexcept
Spr ites
‘Scanned with CamScannerw File Edit View Search Document Project Tools Browser ZC Window Help
é KDC | tos EL ie we
=
import [Link]";
clase jebeDelete
«
public atatle vold main(Stringl] arga) thrown Exception
Clans sorName("sun jibe ode JmeOumeDriver,
Driverttanager-getConnection( jaie:oube:stuett aan"
wtt=0)
[Link]("w"ete"records are deleted”),
[Link]("in ne any record is deleted";
‘step 6: retrive the resuit
ResultSet rmzetexecuteQuery("select * from students
> Syeeumautpriiotrelt ne” name” pereemtons'W
Seek ne ieee
whitoacnes
ni
‘[Link](” »"*[Link](1}+" "[Link](2}+" «"[Link](3));
d
‘atepT: close connection ef the atatement
[Link])
[Link];
lle
Le jdbeDeletejava | 2 meusendapjare —einetPregine - equelSjne
‘Scanned with CamScannerImport Javanet"1
Import Javacto."t
erverd
ServerSocket #88 new Serversocket{1234)1
Socket [Link]())
ButferedResder br « new ButferedReader(new InputStreamReader([Link])h
BufferedReader in = new BufferedRenderinew InputStreamRender([Link])
PrintWeiter out = new PrintWrlter(new OutputStreamWriter([Link]()}
‘string ate“
‘String az="
a
whitectrue)
‘
trequired messege from eliont
[Link](s
Systeroutprint(-n trem ellent=+a4y
.
Msteequata(’ston"))
‘break
tread trom keyboard
[Link](me Type here it
s2abrroadLinet
—<———
outprintin(s2h,
‘outsushoy
Scanned with CamScanner#23. write a program to create three buttons with caption OK,RESET & CANCEL.
import [Link].*;
Import [Link].*;
r
=
aNonnuna
9 public class prg1 extends Applet
40 {
1 Button b1,b2,b3;
12 public void init
43 £
44 bi=new Button("0K");
45 b2=enew Button(” RESET");
16 b3=new Button("CANCEL");
47 add(b1);
48 add(b2);
19 add(b3);
Scanned with CamScannerTaye fave program
Import java
“
‘
pebllc clas pega extends Applet
c
Program to demost
2 Import Javax-swing.'s
2 Import [Link].*;
© the wse of tree component In swing
tree extends JFrame
40 _DetmulttutabletreeNede vegrede + new Defaulted
11 vepnode,ada(now DetaultMutabletreenode("Carot")
12 Yegnodecedd{new DefaullMutableTreeNede(-Tomnto")
43 ‘tadd(vegnode);
ta
is
Maven
via detateetao 200d
12 deaviate(ereyy
aa
‘Scanned with CamScanner22 public static void maln(String[] args)
2a ¢
24 new tree();
25}
26 }
27
‘pik ds Bop ea ee
roman
Bove
t
lr de peor eh at i 0 20
peer hepa 50)
‘Bei 161 Se ate
estat
FRR alegre
ho Se
san,
stat
1 eprint EH_ON. CLOSE, Concetntae
il
pata
ae ge 200)
5 peat,
‘Scanned with CamScannertesto net tt
sen
patent
i
site stertnen estat)
te vi eyressedtcySent he)
Sntnarhe gta
arenas
> pers)
cae eyoent vn Fi
Series pes
2 yon. um
Soentyiapeaaes
‘ee rayon nome
‘Scanned with CamScanneraytramon)
4
setoackground{[Link]};
setviemioterue),
setsiza(400,200))
SetLayout(new FlowLayeutO);
Inbarenew tenuBart
‘etttontarimbar
Alomnew Manet
‘edits new Monut"odi
Henew MonuttomCNow",
tenew Menuiter(Ope0"h
anew Menultom(s3¥2"%
[Link],
fie-naat2s
fle-sdat3h
‘damindowtistener(now Winsownaapter()
(indawwavant o)
Scanned with CamScanner1142. url program to find port ,host , protocol ,gotfilo.
Import [Link].*;
Public class URLConnectionExample {
public static vold main(Stringf] args) {
try
URL url = new URL("httpil/[Link]"}/f Change to the site you want to connect to
URLConnection connection = [Link]();
[Link]
[Link](“Protoc:
‘[Link](“Host: " + [Link]()
‘[Link](“Port: ~ + [Link]()}s
}[Link](*Derault Port: " + [Link]());
[Link](“Filo: " + [Link]()
[Link]("External Form: ” + [Link]()};
} catch (Exception 0) {
[Link]();
?
}
” + url. getProtocol()};
,
Scanned with CamScanner10
4“
3
44
48
46
7
4n
49
20
a
128. wiite a prouram to creat
Import [Link]
Import javaappiet.";
“applet code =prot width=400 height=400>
applet
”
Public clasa prot extends Applet
1
ution ©1,02,03;
[pUBINE Wat sity
basnew Butlon” RESET);
bSenew Butlon(CANCEL"),
exiel(t):
cocel(b2);
cacilth3}:
‘Three buttons with capdon OK RESET & CANCEL ~
Scanned with CamScanner[ine 28 VSS BT
Tass 6 a7 ©7817 e147
sswordfleld to accent password from user Andi the length Is leas Than 6 charae
aorward longth act bet charnetees” *!
143. Wile a program wslna JP
should be divplayed
Import javaapplet."}
Import Javaawt.*;
Import re [Link]. tt
Import [Link].
ight=an0>
(pable clase Tutortalt extends JApplot inpplements ActionListener
«
Habe i432;
“STeetrieta tt4,012;
Password leld pase:
Button
Container 95
ord itt)
engercontantpane(i:
eoetLayaut(new Gridhayout(Sst)}s
jenew JLabelf"Enter Usernane"h
{Qanew Jtabal(-Entor Pavewort!
ew JButten("Logln"k
tener JTentFlelds
sat TooMTIpTaxt{"Enter Username:
unr
Scanned with CamScannersen Tot tres 70 Wid Hele
x Pea AA
teh ferment
a 12 7 3 7
73 Wienew JTexthieli(;
PA IA. setToolTipTent("Entor Username!)
gr Uz=new JTextFlet(y
20 —_-passenew JPasswordField(;
29 oe Too!TIpT ext("Entor Passwort
30 waa
a [Link](ttt);
| 32 cade (12);
33 eumddl(pasn)s
31 wade tF2)1
33
26
7}
38 public void actionPesformed(ActionEvent ae)
3 of
20 String [Link]:
44 [Link])<6)
a 1
“3 [Link]("Password must be gros
aa ,
45 sive
a6 t
a1 WD setText("Correct
an 1
a}
20 }
Je
Scanned with CamScannerYou might also like