Week-9 Date:
------------------------------------------------------------------------------------------------------------
AIM: Install a database (Mysql or
Oracle).
Create a table which should contain at least the
following fields: name, password, email-id, phone number (these should hold the
data from the registration form).
Practice 'JDBC' connectivity.
Write a java
program/servlet/JSP to connect to that database and extract data from the
tables and display them. Experiment with various SQL queries.
Insert the details of
the users who register with the web site, whenever a new user clicks the submit
button in the registration page (week2).
DESCRIPTION:
JDBC Driver Types
There are four types of JDBC drivers in use:
Type 1: JDBC-ODBC Bridge
A Type 1 JDBC-ODBC Bridge provides
application developers with a way to access JDBC drivers via the JDBC API. Type
1 JDBC drivers translate the JDBC calls into ODBC calls and then send the calls
to the ODBC driver. Type 1 JDBC drivers are generally used when the database
client libraries need to be loaded on every client machine.
Type 2: Native API/Partly Java
Driver
A Type 2 Native API/Partly Java Driver is a
partial Java driver because it converts JDBC calls into database specific
calls. Type 2 Native API/Partly Java Driver communicates directly with the
database server.
Type 3: Pure Java Driver
A Type 3 Pure Java Driver works in a three
tiered architecture. The JDBC calls are passed via the network to the middle
tier server. This server translates the calls to the database specific native
interface to further request the server. JDBC drivers available from Simba are
Type 3 drivers.
Type 4: Native Protocol Java
Driver
The type 4 driver
is written completely in Java and is hence platform independent. It is
installed inside the Java Virtual Machine of the client. It provides better
performance over the type 1 and 2 drivers as it does not have the overhead of
conversion of calls into ODBC or database API calls. Unlike the type 3 drivers,
it does not need associated software to work.A Type 4
Native Protocol Java Driver converts JDBC calls into the database specific
calls so that the client applications can communicate directly with the server.
PROGRAM:
Registration.html:
<html>
<head>
<title>Registration page</title>
</head>
<body bgcolor="#00FFFf">
<form METHOD="POST" ACTION="register">
<CENTER>
<table>
<center>
<tr> <td> Username </td>
<td><input type="text" name="usr">
</td> </tr>
<tr><td> Password </td>
<td><input type="password" name="pwd">
</td> </tr>
<tr><td>Age</td>
<td><input type="text" name="age">
</td> </tr>
<tr> <td>Address</td>
<td> <input type="text" name="add">
</td> </tr>
<tr> <td>email</td>
<td> <input type="text" name="mail">
</td> </tr>
<tr> <td>Phone</td>
<td> <input type="text" name="phone">
</td> </tr>
<tr> <td colspan=2 align=center> <input
type="submit" value="submit"> </td> </tr>
</center>
</table>
</form>
</body>
Login.html
<html>
<head>
<title>Registration page</title>
</head>
<body bgcolor=pink> <center> <table>
<form METHOD="POST" ACTION="authent">
<tr> <td> Username </td>
<td><input type="text"
name="usr"></td> </tr>
<tr> <td> Password </td>
<td> <input type="password" name="pwd">
</td> </tr>
<tr> <td align=center colspan="2"><input
type="submit" value="submit"></td> </tr>
</table> </center>
</form>
</body>
</html>
Ini.java:
import javax.servlet.*;
import java.sql.*;
import java.io.*;
public class Ini extends GenericServlet
{
private String user1,pwd1,email1;
public void service(ServletRequest req,ServletResponse res) throws
ServletException,IOException
{
user1=req.getParameter("user");
pwd1=req.getParameter("pwd");
email1=req.getParameter("email");
res.setContentType("text/html");
PrintWriter out=res.getWriter();
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection
con=DriverManager.getConnection("jdbc:oracle:thin:@195.100.101.158:1521:cclab","scott","tiger");
PreparedStatement
st=con.prepareStatement("insert into personal values(?,?,?,?,?,?)");
st.setString(1,user1);
st.setString(2,pwd1);
st.setString(3,"25");
st.setString(4,"hyd");
st.setString(5,email1);
st.setString(6,"21234");
st.executeUpdate();
con.close();
}
catch(SQLException s)
{ out.println("not found
"+s);
}
catch(ClassNotFoundException c)
{
out.println("not found
"+c);
}
} }
web.xml:
<web-app>
<servlet>
<servlet-name>init1</servlet-name>
<servlet-class>Ini</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>init1</servlet-name>
<url-pattern>/regis</url-pattern>
</servlet-mapping>
</web-app>
OUTPUT:
http://wikibrand.blogspot.in |
http://wikibrand.blogspot.in |
http://wikibrand.blogspot.in |
http://wikibrand.blogspot.in |
http://wikibrand.blogspot.in |
http://wikibrand.blogspot.in |
http://wikibrand.blogspot.in |
http://wikibrand.blogspot.in |
RESULT:
Thus a table is created and the
details are entered into the table using jdbc from the registration form
successfully.
SOURCE:PVPSIT FOR JNTU
perfect explanation about java programming .its very useful.thanks for your valuable information.dot net training center in chennai | java training in velachery
ReplyDeleteThanks a lot! You made a new blog entry to answer my question; I really appreciate your time and effort.java training in chennai | chennai's no.1 java training in chennai
ReplyDeleteNice blog it's very helpful information. Thanks for sharing. keep sharing such
ReplyDeleteinformative Ideas
extract phone numbers
from website
Excellent blog, I wish to share your post with my folks circle. It’s really helped me a lot, so keep sharing post like this
ReplyDeletejava training in chennai | java training in bangalore
java online training | java training in pune
java training in chennai | java training in bangalore
java training in tambaram |
Well Said, you have furnished the right information that will be useful to anyone at all time. Thanks for sharing your Ideas.
ReplyDeletepython training in omr
python training in annanagar | python training in chennai
python training in marathahalli | python training in btm layout
python training in rajaji nagar | python training in jayanagar
Thanks you for sharing this unique useful information content with us. Really awesome work. keep on blogging
ReplyDeleteHadoop Training in Chennai
Aws Training in Chennai
Selenium Training in Chennai
I am definitely enjoying your website. You definitely have some great insight and great stories.
ReplyDeleteData Science Training in Chennai
Data science training in bangalore
Data science online training
Data science training in pune
Data science training in kalyan nagar
selenium training in chennai
A very nice guide. I will definitely follow these tips. Thank you for sharing such detailed article. I am learning a lot from you.
ReplyDeletepython online training
python training in chennai
Read all the information that i've given in above article. It'll give u the whole idea about it.
ReplyDeletejava training in tambaram | java training in velachery
java training in omr | oracle training in chennai
Thank you for benefiting from time to focus on this kind of, I feel firmly about it and also really like comprehending far more with this particular subject matter. In case doable, when you get know-how, is it possible to thoughts modernizing your site together with far more details? It’s extremely useful to me
ReplyDeletepython training in chennai
python training in chennai
python training in Bangalore
This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
ReplyDeleteangularjs Training in chennai
angularjs Training in chennai
angularjs-Training in tambaram
angularjs-Training in sholinganallur
angularjs-Training in velachery
Good Post, I am a big believer in posting comments on sites to let the blog writers know that they ve added something advantageous to the world wide web.
ReplyDeleteData science course in tambaram | Data Science course in anna nagar
Data Science course in chennai | Data science course in Bangalore
Data Science course in marathahalli | Data Science course in btm
ReplyDeleteHowdy, would you mind letting me know which web host you’re utilizing? I’ve loaded your blog in 3 completely different web browsers, and I must say this blog loads a lot quicker than most. Can you suggest a good internet hosting provider at a reasonable price?
Amazon Web Services Training in OMR , Chennai | Best AWS Training in OMR,Chennai
Amazon Web Services Training in Tambaram, Chennai|Best AWS Training in Tambaram, Chennai
Thank you for sharing such great information with us. I really appreciate everything that you’ve done here and am glad to know that you really care about the world that we live in
ReplyDeleteangularjs online Training
angularjs Training in marathahalli
angularjs interview questions and answers
angularjs Training in bangalore
angularjs Training in bangalore
Does your blog have a contact page? I’m having problems locating it but, I’d like to shoot you an email. I’ve got some recommendations for your blog you might be interested in hearing.
ReplyDeleteAWS Training in Pune | Best Amazon Web Services Training in Pune
AWS Tutorial |Learn Amazon Web Services Tutorials |AWS Tutorial For Beginners
Amazon Web Services Training in OMR , Chennai | Best AWS Training in OMR,Chennai
AWS Training in Chennai |Best Amazon Web Services Training in Chennai
Amazon Web Services Training in Pune | Best AWS Training in Pune
Thanks a lot for sharing us about this update. Hope you will not get tired on making posts as informative as this.
ReplyDeleteMicrosoft Azure online training
Selenium online training
Java online training
Java Script online training
Share Point online training
I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.
ReplyDeleteData science Course Training in Chennai |Best Data Science Training Institute in Chennai
RPA Course Training in Chennai |Best RPA Training Institute in Chennai
AWS Course Training in Chennai |Best AWS Training Institute in Chennai
Devops Course Training in Chennai |Best Devops Training Institute in Chennai
Selenium Course Training in Chennai |Best Selenium Training Institute in Chennai
Java Course Training in Chennai | Best Java Training Institute in Chennai
It has been simply incredibly generous with you to provide openly what exactly many individuals would’ve marketed for an eBook to end up making some cash for their end, primarily given that you could have tried it in the event you wanted.
ReplyDeleteData Science Training in Chennai | Data Science Course in Chennai
Python Course in Chennai | Python Training Course Institutes in Chennai
RPA Training in Chennai | RPA Training in Chennai
ReplyDeleteThanks for sharing such a valuable information. The context has been explained really well. Follow us for more Info on Data Science at Data Science Training In Hyderabad
I would like to share the informative contents with my office circle...Really the contents of the blogs are creating a good opportunities...Keep posting
ReplyDeleteJava training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery
Thanks for uploading this Blog. the blog is really impressive and very neat to understand the concept.
ReplyDeleteData Science Training Course In Chennai | Data Science Training Course In Anna Nagar | Data Science Training Course In OMR | Data Science Training Course In Porur | Data Science Training Course In Tambaram | Data Science Training Course In Velachery
ReplyDeleteGreat Article
Cloud Computing Projects
Networking Projects
Final Year Projects for CSE
JavaScript Training in Chennai
JavaScript Training in Chennai
The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
ReplyDeleteThe Content You Shared With Us Is Excellent & Extraordinary Useful to all Aspirants Thanks For Sharing With Us!
Best Degree College In Hyderabad
Top Degree College In Hyderabad
Top And Best BBA College In Hyderabad
Top And Best B.Com College In Hyderabad
It is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. It is really explainable very well and i got more information from your blog. Please, continue to give me such valuable posts.Data Science Training In Chennai
ReplyDeleteData Science Online Training In Chennai
Data Science Training In Bangalore
Data Science Training In Hyderabad
Data Science Training In Coimbatore
Data Science Training
Data Science Online Training
This article gives more useful information to me. Great post .Thanks for sharing useful information. oracle training in chennai
ReplyDeleteThis is the exact information I am been searching for, Thanks for sharing the required infos with the clear update and required points. To appreciate this I like to share some useful information.
ReplyDeleteJava Training in Chennai
Java Training in Velachery
Java Training in Tambaram
Java Training in Porur
Java Training in OMR
Java Training in Annanagar
If Big Data is a job that you're dreaming of, then we, Infycle are with you to make your dream into reality. Infycle Technologies offers the best Big Data Course Chennai, with various levels of highly demanded software courses such as Java, Python, Hadoop, AWS, etc., in 100% hands-on practical training with specialized tutors in the field. Along with that, the pre-interviews will be given for the candidates, so that, they can face the interviews with complete knowledge. To know more, dial 7502633633 for more.
ReplyDeletehttps://infycletechnologies.com/big-data-training-in-chennai/
Title:
ReplyDeleteTop Oracle DBA Training in Chennai | Infycle Technologies
Description:
Want to learn Oracle DBA along with the job opportunities? Infycle are with you to make your dream into reality. Infycle Technologies gives the most trustworthy Oracle DBA Training in Chennai, in 100% hands-on practical training with professional tutors in the field. Along with that, the mock interviews will be assigned for the candidates, so that, they can meet the job interviews with full confidence. To transform your career to next level, call 7502633633 to Infycle Technologies and grab a free demo to know more
Top training Institute in Chennai
ReplyDeleteThanks for posting the best information and the blog is very important.
Visit us: Java Online Training Hyderabad
Visit us: Core Java Online Course
Visit us: java course
Great blog found to be well written in a simple manner that everyone will understand and gain the enough knowledge from your blog
ReplyDeleteAWS Training in Hyderabad
Did you want to set your career towards Big Data? Then Infycle is with you to make this into reality. Infycle Technologies gives the combined and best Big Data Hadoop Training in Chennai, in 100% hands-on training guided by specialized trainers in the field. In addition to this, the mock interviews will be given to the candidates, so that they can face the interviews with complete confidence. Apart from all, the candidates will be placed in the top MNC's with a great salary package. To get it all, call 7502633633 and make this happen for your happy life.
ReplyDeleteBEST TRAINING IN CHENNAI
Grab the Digital Marketing Training in Chennai from Infycle Technologies, the best software training institute, and Placement center in Chennai which is providing professional software courses such as Data Science, Artificial Intelligence, Cyber Security, Big Data, Java, Hadoop, Selenium, Android, and iOS Development, DevOps, Oracle etc with 100% hands-on practical training. Dial 7502633633 to get more info and a free demo and to grab the certification for having a peak rise in your career.
ReplyDeleteI want to say thanks to you. I have bookmark your site for future updates.
ReplyDeletedata scientist certification malaysia
If salary is your only income means. Simply think to make it HIGH by getting into AWS training institute in Chennai, Infycle. It will be so easier for you because, past 15 years software industry Infycle leads a 1 place for giving a best students in IT industry.
ReplyDeleteFinish the Selenium Training in Chennai from Infycle Technologies, No.1 software training institute in Chennai which is providing professional courses for students, freshers, experienced, and tech professionals. We provide courses like DevOps, Artificial Intelligence, Cyber Security, Python, Oracle, Java, Power BI, Digital Marketing, Data Science, etc. with the best trainers receiving amazing training for the best career. For more details and demo classes call 7504633633.
ReplyDeleteVery awesome blog. Great stuff. Informative content. Very useful to many people. Keep up this good work.
ReplyDeleteData Science Training and Placements in Hyderabad
In the wake of perusing your article, I was astounded. I realize that you clarify it well overall. What's more, I trust that different perusers will likewise encounter how I feel in the wake of perusing your article.
ReplyDeletedata science institutes in hyderabad
Great info! I recently came across your blog and have been reading along. I thought I would leave my first comment. I don’t know what to say except that I have.
ReplyDeletecyber security course in malaysia
Excellent information! I just discovered your site and have been following along. I intended to post my initial comment. The only thing I can say is that I have. customer relationship management in erp
ReplyDelete