0% found this document useful (0 votes)
3 views2 pages

Java JDBC Prepared Statements Guide

Uploaded by

Priya Solapure
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Java JDBC Prepared Statements Guide

Uploaded by

Priya Solapure
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

Prepared Statement

=========================================================

public class InserJdbc {

public static void main(String[] args) throws ClassNotFoundException,


SQLException {
String querry= "insert into student values(?,?,?,?)";
[Link]("[Link]"); //load the driver class
Connection con =
[Link]("jdbc:mysql://localhost:3306/demo","root","Shubpiyo@151
1");
PreparedStatement pst = [Link](querry);
[Link](1, 6);
[Link](2, "Manish");
[Link](3, 25);
[Link](4, "Manish1411@[Link]");
[Link]();

//[Link](); //close the connection

===================================================================
1)Difference between prepared statement and statement

==================================================================
callable statement:

Stored procedure / function

public static void main(String[] args) throws ClassNotFoundException, SQLException


{
String querry= "{? = call addingNum(?,?)}";
[Link]("[Link]"); //load the driver class
Connection con =
[Link]("jdbc:mysql://localhost:3306/demo","root","Shubpiyo@151
1");
CallableStatement pst = [Link](querry);

[Link](1, 6);
[Link](2, 7);

[Link](1, [Link]);
[Link]();
//[Link](); //close the connection

//

==================================================================
Java Servlet

[Link] is a technologogy which is used create web application.


[Link] is server side programming this means server is mandatory to run your
program.
[Link] is a component which serves the client request and generate dynamic
content.
[Link] interacts with web client through request-response things.
[Link] clients request are send to the web server through servlet.
[Link] receives client request in the form of HTTP Request.

HTTP Request - GET, PUT, POST, DELETE

Features of Servlet:
[Link] is a platform independent
[Link]
[Link] managemenet.

=============================================================================
Work of servelet

[Link] receives client request in the form of HTTP Request.


[Link] information from HTTP request means which kind of request is this(GET,
PUT, POST, DELETE)
from where request comes(IP address)
[Link] content generation or business logic process.
[Link] the response in the form of HTTP Response

HTTP Response
[Link] Line

HTTP/1.1 200 OK

[Link] Headers
[Link]

====================================================

Difference between get, put , post ,delete

You might also like