Home Answers Viewqa JSP-Servlet Programming skills

 
 


sowjanya
Programming skills
1 Answer(s)      5 years and 3 months ago
Posted in : JSP-Servlet

Hi, I visited this site for the first time.It's excellent. I want 2 improve my programming skills.Can u pls help me in making programs using JSP's and servlets.

View Answers

April 10, 2008 at 7:58 PM


Hi friend

<html>

<head>
<title>Insert value in database</title>
</head>

<body>

<table border="1" width="50%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<h1><center>Insert value in Database</center></h1>
<form method="POST" action="InsertAction.jsp">

<table border="1" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" valign="right"><b>Name:</b></td>
<td width="50%"><input type="text" name="username" size="30"></td>
</tr>
<tr>
<td width="50%" valign="right"><b>Job-Position:</b></td>
<td width="50%"><input type="text" name="jobposition" size="30"></td>
</tr>
<tr>
<td width="50%" valign="right"><b>Date:</b></td>
<td width="50%" valign="right"></td>
</tr>
</table>
<p><input type="submit" value="Submit">
<input type="reset" value="Reset"></p>
</form>
</td>
</tr>
</table>
</body>
</html>

InsertAction.jsp

<%@ page language="java" import="java.sql.*,java.util.*,java.text.*" %>

<%

Connection con = null;
String url = "jdbc:mysql://localhost:3306/";;
String db = "register";
String driver = "com.mysql.jdbc.Driver";
java.util.Date date;
String s=null;
try{
Class.forName(driver);
con = DriverManager.getConnection(url+db,"root","root");
try{
Statement st = con.createStatement();
String username=request.getParameter("username");
String jobposition=request.getParameter("jobposition");
DateFormat dformat = new SimpleDateFormat("yyyy-MM-dd");

try{
date = new java.util.Date();
s = dformat.format(date);
out.println("Today = " + s);
}
catch(Exception e){
e.getMessage();
}
int val = st.executeUpdate("insert user_details values('"+username+"','"+jobposition+"','"+s+"')");
String query = "SELECT date FROM user_details";
ResultSet rs = st.executeQuery(query);
while (rs.next()) {
out.println(rs.getString(1) + " " + rs.getString(2) + "<br>");
}
rs.close();
con.close();
out.println("success");
}
catch (SQLException ex){
System.out.println("SQL statement is not executed!");
}
}
catch (Exception e){
e.printStackTrace();
}

%>

------------------

read for more information.

http://www.roseindia.net/jsp/
http://www.roseindia.net/servlets/

Hope it will help u.










Related Pages:
Programming skills - JSP-Servlet
Programming skills  Hi, I visited this site for the first time.It's excellent. I want 2 improve my programming skills.Can u pls help me in making programs using JSP's and servlets.  Hi friend<html><head><
Online Java Programming Courses
in honing the Java programming skills of our students so that they meet all the requirements of the IT market. Online Java programming courses from Rose India...Java Programming Courses Online Online Java Programming Technology has become
developing skills in java , j2ee - Java Beginners
developing skills in java , j2ee   How to understand or to feel the flow of java or j2ee programme what is the way to become a expert programmer can you please give me tips thanking you
iPhone Programming Training Course
iPhone Programming Training Course Our iPhone Programming Training Course... Programming Training Course, you will be able to develop, test and release... for application testing Creating distribution builds Skills acquired
Programming
Programming  Given a number n, write a programming to determine its square root if it is possible, in the contraly case print an appropriate massege on the screen
programming
Java Constructor programming for single and double constructor  write a program which have no argument constructor ,single parameter constructor constructor,double parameter constor,and the now when we create a object
Java Programming: Chapter 6 Index
to these events as they occur. Event-driven programming builds on all the skills... Chapter 6 Applets, HTML, and GUI's JAVA IS A PROGRAMMING LANGUAGE... are doing the kind of programming-in-the-small that was covered in Chapters 2
Java Programming: Section 2.4
facilities, and it requires some advanced Java programming skills to use... of object-oriented programming to use this class. There is also a new formatted.... For those of you familiar with the C programming language, System.out.printf
Software Application Development, Programming and Application Testing Solutions and Services
Services Custom Application development requires not just commitment and skills... completes the required programming the project manager checks the application... development and deployment Multimedia Development System Programming Embedded
Ask Programming Questions Online
Ask Programming Questions Online   ..., the integrated programming problems are also increasing. There are countless numbers..., in several programming languages to be designed to run on different browsers
MCA Project Training
their technical skills and proficiencies into real time development environment. The course contains fundamental and advance introduction to the modern programming languages... in Java, you will be able to explore your technical skills with innovative ideas
Animated Web Design
Animated Web Design Animation needs the higher skill of work and experience, and animation on web not only need the art but also need the technical skills like scripting, programming and coding. The sketching illustration with mouse
Skill Managing Projects,Outsourcing Project Managing Skills,What are the Skills for Managing Projects?
What are the Skills for Managing Projects? Introduction Imagine... The project manager has to consider himself/herself as a leader. Skills... these skills. Resolve Problems Effectively Resolving problems is a day to day
Programming with JSP
Programming with JSP  Who will post me the answer
Java Programming
Java Programming  Hi, What is Java Programming? How I can learn Java Programming in one month? Thanks
Programming
Java NotesProgramming Here are some tips on making programming student problems easier. Start from an existing, running, program. If you can find... of the basic elements of Extreme Programming (a much hyped, but good
Ajax programming
Ajax programming  Hi, How I can start ajax programming easily? I... concept. What should be my starting point for Ajax programming? Thanks   Hi, If you have prior programming experience in any web development
Programming with JSP
Programming with JSP  Write a program using jsp that accepts a course code as input and displays the course title the program to which it belongs
Programming (general)
Programming (general)  I haven't yet started college/university but I'm interested in studying programming. I wondering if programming is difficult or confusing with all the codes you have to learn? Also how many languages would
programming of foxpro
programming of foxpro  hello sir , sir i am use the foxpro . but i know about c . sir how can i learn fox pro . i know about something about foxpro
programming concept
programming concept  Write a program that allows the user to input a total dollar amount for an online shopping order and computes and outputs the shipping cost based on the following schedule
programming error
programming error  I got an error when i did the following program the prg. is to "select the name from database when the age is given for the respective name" error i got is:SQL exception please give me the solution by providing
Socket Programming
Socket Programming  How to connect a computer through IP only and check whether it is up and running? I can't see any method in Socket programming where I can pass only IP address as argument. I need the pass port number also
C Programming
C Programming  hi,how can i write a program in C programming to place reservation in air plane from the menu let the user to inter his/her gender(W or M)and draw seats by using ascii codes and choose where he/she will sit
Programming Assignment
Programming Assignment  Hey there, We were given an assignment to write a program to read 10 student marks from the keyboard without using an Array (only using switch statements, if statements or loops). As each mark is input
programming questions
programming questions  this is my assignment questions please help me... the programs in c# language Describe the following with respect to creating Web Forms in .Net environment: a. Web Form Life Cycle b. Creating a Web Form
ajax programming
Ajax Programming What is Ajax Programming? Asynchronous JavaScript and XML... is based on the HTML, Java Script, CSS, and XML. Why Ajax Programming? When you.... Easy to learn and easy to write technology. Where to Start Ajax Programming
programming problem
programming problem   Kingdom of Maplewood is a beautiful country comprising of a lot of small islands of different areas. All the islands are in a straight row. King Rosewood is getting old and has decided to divide the islands
Java Programming
Java Programming  Write a Java program that prompt user to input a number of students in a class. Then, prompt user to input the studentÃ?¢ââ??‰â??¢s programming mark. Determine how many student get A+ and A for their grade
java programming
java programming  Write a Java program that prompt user to input a number of students in a class. Then, prompt user to input the studentâ??s programming mark. Determine how many student get A+ and A for their grade and how many
programming - Java Beginners
programming for java beginners  How to start programming for java beginners
What is programming logic ?
What is programming logic ?  What is programming logic
programming - Java Beginners
Start programming in Java  Programming in Java - Can any one please suggest how to start programming in Java