how to connect jdbc

Ads
 

how to connect jdbc

package com.tcs.ilp.Try.Controller;

import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList;

import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession;

import com.tcs.ilp.Try.Model.Beans; import com.tcs.ilp.Try.Model.MyHelper;

/** * Servlet implementation class Servlet1 */ public class Servlet1 extends HttpServlet { private static final long serialVersionUID = 1L;

/**
 * Default constructor. 
 */
public Servlet1() {
    // TODO Auto-generated constructor stub
}

/**
 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
 */
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
{











}

/**
 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
 */
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
{
    HttpSession session=request.getSession();
    PrintWriter out=response.getWriter();
    out.println("Entred post");
    String str2=request.getParameter("submit");
    out.println(str2);
    //ArrayList<Beans> c=new ArrayList<Beans>();
    String str=request.getParameter("username");
    String str1=request.getParameter("password");

    ArrayList<Beans> a=new ArrayList<Beans>();

    if(str2.equals("Login"))
            {
        System.out.println("Entred if");

    //System.out.println(a);
        int d;
    d=MyHelper.insert(str,str1);
    //Beans b=new Beans();
    a=MyHelper.view();


    session.setAttribute("registration",a);
    response.sendRedirect("Reg_users.jsp");
            }
    if(str2.equals("Update"))
    {
        MyHelper.update(str,str1);
    }
    if(str2.equals("logout"))
    {
        session.invalidate();
        System.out.println("Successfully Deleted");
    }
}

}

View Answers

Ads









Related Tutorials/Questions & Answers:
how to connect jdbc
how to connect jdbc  package com.tcs.ilp.Try.Controller; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import
what is ment by jdbc and how to connect with database?
what is ment by jdbc and how to connect with database?  i want answer for this question
Advertisements
How to connect with database
How to connect with database  jdbc connection
How to connect
How to connect  how to connect to a remote host using jsp? We need to update files to the database of the application on the local machine from the updated database on our webpage
How to connect to MySQL in JSP?
How to connect to MySQL in JSP?  How to connect to MySQL in JSP..., You can use the Java JDBC code to connect to MySQL database in JSP page. Check the tutorial: Connect JSP with mysql Thanks
not able to connect to mysql using.. jdbc
not able to connect to mysql using.. jdbc   i am not able to connect to mysql using jdbc .. is there any classpath that i need to set..because i am using mysql-connector-java jar file..to connect to mysql.. Pls provide the steps
how to connect webcam in html
how to connect webcam in html  how to connect webcam in html.emphasized text
JDBC Connection code to connect servlet with oracle.
JDBC Connection code to connect servlet with oracle.  JDBC Connection code to connect servlet with oracle
How to connect mysql with jsp
How to connect mysql with jsp  how to connect jsp with mysql while using apache tomcat
how to connect program to database
how to connect program to database  Sir i want ur help in my program. I want to save the data in the database. When i'll click on save button the entered data must be save in the database. I want an action performed method
how i connect two page
how i connect two page  strong textlink text
How to connect on screen keyboard to system.
How to connect on screen keyboard to system.  How to connect on screen keyboard to system.I made on screen keyboard in java(swing).Now i want connect to system means when i pressed any button then it type on notepad or any
How to connect on screen keyboard to system.
How to connect on screen keyboard to system.  How to connect on screen keyboard to system.I made on screen keyboard in java(swing).Now i want connect to system means when i pressed any button then it type on notepad or any
how to resolve this JDBC Error?
how to resolve this JDBC Error?  i am trying to Exceute this code... = "oracle.jdbc.driver.OracleDriver"; String dburl = "jdbc:oracle:oci:@localhost... of SID given in connect descriptor
How to download MySQL JDBC driver?
How to download MySQL JDBC driver?  Hi, What is JDBC Driver? How to download MySQL JDBC driver? Thanks   Hi, JDBC - Java database... program. To connect to MySQL database from Java program we need JDBC Driver of MySQL
how to connect two swing frames
how to connect two swing frames  how to connect two swing frames   Hi Friend, Try this: 1)LoginDemo.java: import java.sql.*; import...("com.mysql.jdbc.Driver"); Connection con = DriverManager.getConnection("jdbc
how to connect SQL Server 2005 using php
how to connect SQL Server 2005 using php  i need to connect SQL Server 2005 using php. how can i connect . how to use mssql_connect function
HOW TO CREATE COMMENT IN WEBSITE AND CONNECT TO DATABASE?
HOW TO CREATE COMMENT IN WEBSITE AND CONNECT TO DATABASE?  HOW TO CREATE COMMENT IN WEBSITE AND CONNECT TO DATABASE
how to connect two databse through HibernateFramework
how to connect two databse through HibernateFramework  how to connect two databse through HibernateFramework
HOW TO CREATE COMMENT IN WEBSITE AND CONNECT TO DATABASE?
HOW TO CREATE COMMENT IN WEBSITE AND CONNECT TO DATABASE?  HOW TO CREATE COMMENT IN WEBSITE AND CONNECT TO DATABASE
how to connect client to server using Sockets
how to connect client to server using Sockets  how to connect client to server using Sockets
how to connect to database in php using mysql
how to connect to database in php using mysql  how to connect to database in php using mysql
how to connect mySql drivers into eclipse(configuration)?
how to connect mySql drivers into eclipse(configuration)?  how to connect mySql drivers into eclipse(configuration)? I need the configuration in eclipse. what do i have to download from mySql and just downloading is enough or do
How can i use Facebook connect button
How can i use Facebook connect button  Please to meet you all guys I wonder how can i use this Connect to facebook for me to post in a particular... http://likekhevy4.blogspot.com/ How can i apply this kind of comment with "Connect
how to connect to MS access database in JSP?
how to connect to MS access database in JSP?  how to connect to MS access database in JSP? Any seetings/drivers need to be set or installed before... = DriverManager.getConnection("jdbc:odbc:student"); Statement st=con.createStatement
how to connect jsp to mysql - Java Beginners
how to connect jsp to mysql  I m new in Mysql and JSP i m ceating.java file using bean file for connectivity but i m not able to connect jsp... me hw to conncet jsp with mysql this is connection file package connect
JDBC Connection code to connect servlet with SQL Server 2008
JDBC Connection code to connect servlet with SQL Server 2008  Please ans me why it is not connect i use netbeans IDE7.0 Jdk 1.7 i also add... support for JDBC 4.0. i try Avery thing but i m not success so please ans me . My
How Jdbc program can be run??
How Jdbc program can be run??  import java.sql.*; import java.util.... { Connection conn=DriverManager.getConnection("jdbc:odbc:advdsn1","student","myself... to know what is the problem? and how can i run it successfully? please give me
HOW TO RUN JDBC PRORAM ON JDK1.5.0
HOW TO RUN JDBC PRORAM ON JDK1.5.0  import java.sql.*; import... { Connection conn=DriverManager.getConnection("jdbc:odbc:advdsn1","student","myself... driver specified i want to know what is the problem? and how can i run
how to connect java with ms access using odbc in eclipse
how to connect java with ms access using odbc in eclipse  import..."); //Connection con = DriverManager.getConnection("jdbc:odbc:DRIVER={Microsoft... = DriverManager.getConnection("jdbc:odbc:student.accdb"); Statement st
how to run jdbc program in linux-ubuntu?
how to run jdbc program in linux-ubuntu?   how to run jdbc program in linux-ubuntu

Ads