Can anyone please provide the Java Servlet Documentation.
April 4, 2008 at 6:01 PM
hi
Now, run the give code.
ConnectionDatabase.java
import java.io.*;
import java.util.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class ConnectionDatabase extends HttpServlet{
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
Connection conn = null;
String url = "jdbc:
mysql://localhost:3306/";;
String dbName = "register";
String driver = "com.mysql.jdbc.Driver";
String userName = "root";
String password = "root";
try{
Class.forName(driver).newInstance();
conn = DriverManager.getConnection(url+dbName,userName,password);
out.println("Successfully connect to the database");
conn.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
}
web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="
http://java.sun.com/xml/ns/j2ee";
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="
http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";
version="2.4">
<servlet>
<servlet-name>Connection</servlet-name>
<servlet-class>ConnectionDatabase</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Connection</servlet-name>
<url-pattern>/ConnectionDatabase</url-pattern>
</servlet-mapping>
</web-app>
Related Tutorials/Questions & Answers:
java documentation - Java Beginnersjava documentation Sir
my qn is that How to use javadoc tool? please explain this with a small example?
How much memory is allocated for refernce variable, plz also explain me this with example
java documentation - Java Beginnersjava documentation how to use javap command Hi Friend,
The javap command disassembles a class file. Its output depends on the options used. If no options are used, javap prints out the package, protected
Advertisements
Regarding Documentation of PackagesRegarding
Documentation of Packages Hello
How to get
java packages ie
documentation of classes ,Interfaces and methods
from windows command prompt.In the sense Java.lang,java.awt,java.math etc
Regarding Documentation of APIRegarding
Documentation of API Hello
How to get
java documentation.... How to type in Windows command prompt(console) to get the
documentation API.
Give the following command:
javap
java.[packagename].[classname]
eg
Regarding Documentation of APIRegarding
Documentation of API Hello
How to get
java documentation... in Windows command prompt(console) to get the
documentation API.
Give the following command:
javap
java.[packagename].[classname]
eg, javap
JAVA SERVLET - JSP-ServletJAVA SERVLET Log Hi, A
servlet file which create the log files ,then writing values to the list & log, we should have a thousand separator and no decimal values. This means instead of writing 986300.0 in the Log file
java servlet - JSP-Servletjava servlet hi friends,
Thanks in advance. Am poornima am created new
servlet in eclipse its open but without including any code am getting...,
Put
servlet-api.jar into the lib folder of apache tomcat server.
Thanks
java servlet java servlet im using ubuntu 12.04 and ialready installed eclipse but i dont know how to run the
servlet programs please give brief procedure to run the
servlet program in eclipse
Java servletJava servlet What is the difference between an applet and a
servlet Java Servlet - JSP-ServletJava Servlet Hello Sir
Could you help me in understanding directory Structure for
servlet page in eclipse (IDE).
I save my Sevlet in WEB-INF but it is not displaying, it is displaying code of
servlet.
Process used
Java Servlet Problem - JSP-ServletJava Servlet Problem I have a
servlet class that implemets the ServletContextAttributeListener interface. I am overriding all three methods, but in the attributeReplaced() method, i want to perform a redirect to another
servlet JAVA JSP and Servlet - JSP-ServletJAVA JSP and Servlet for sending mail through lan without intenet and also chatting facility for online users using
Java JSP &
SERVLET code. Hi Friend,
Please visit the following links:
http://www.roseindia.net
java servlet programming - JSP-Servletjava servlet programming when i m inserting an image file into the sql table in a column of data type binary using prepared statement ps.setBinaryStream, instead of filename it's displaying
JSP with java/servlet - JSP-Servlet (
java bean or
servlet) to fecth the database. Jsp would get the data from...JSP with
java/servlet Thanks Deepak for your answere to my previous.../
servlet-jsp-data-list.shtml
Hope that it will be helpful for you.
Thanks
Java Servlet - Servlet Interview QuestionsJava Servlet My
Servlet Program is generating Compile time errors.
1)pakage javax.Servlte.Http.* does not exists.
and Pakage javax.Servlte does... be that you have not set the classpath of your
java-
servlet-api.jar in the environment
java,servlet,jsp - JSP-Servletjava,
servlet,jsp i am doing a project on online examination system and in that there are problems that--
1.i want to disable the back,forward and refresh button.Please give me the code for google crome browser.
2.suppose
JAVA - JSP-ServletJava servlets sessions session tracking How to track the session in
Servlet java - JSP-Servletjava why is required to write both jsp and
servlet in a application of
java java servlet - Java Beginnersjava servlet how to use
java servlet? and what the purpose of
servlet? Hi Friend,
Please visit the following link:
http://www.roseindia.net/servlets/
Hope that it will be helpful for you.
Thanks