Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML

Tutorial Categories: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML

Fresher Job


 

Search Host

Monthly Fee($)
Disk Space (MB)
Register With us for Newsletter!
Visit Forum! Post Questions!
Jobs At RoseIndia.net!

Have tutorials?
Add your tutorial to our Java Resource and get tons of hits.

We offer free hosting for your tutorials. and exposure for thousands of readers. drop a mail
roseindia_net@yahoo.com
 
   

Tutorials

Java Server Pages

JAXB

Java Beans

JDBC

MySQL

Java Servlets

Struts

Bioinformatics

Java Code Examples

Interview Questions

 
Join For Newsletter

Powered by groups.yahoo.com
Visit Group! Post Questions!

Web Promotion

Web Submission

Submit Sites

Manual Submission?

Web Promotion Guide

Hosting Companies

Web Hosting Guide

Web Hosting

Linux

Beginner Guide to Linux Server

Frameworks

Persistence Framework

Web Frameworks

Free EAI Tools

Web Servers

Aspect Oriented Programming

Free Proxy Servers

Softwares

Adware & Spyware Remover

Open Source Softwares

servlets
Expert:shaziya
hi deepak,
u had replied my question for employee details.. i compiled it and a class file file was created also without any error. but when i run it by giving the command java InsertDataAction.java it is giving a error as,
Exception in thread "main" java.lang.NoClassDefFoundError:InsertDataAction/java

can u plzz tel me whats the error .. the program which u had given is as follows:

package javacode;

import java.io.*;
import java.sql.*;

import javax.servlet.*;
import javax.servlet.http.*;

public class InsertDataAction extends HttpServlet{
public void doGet(HttpServletRequest request, HttpServletResponse response)throws
ServletException, IOException{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
System.out.println("Insert data Example!");
String driver = "com.mysql.jdbc.Driver";
String url = "jdbc:mysql://192.168.10.211:3306/";;
String db = "amar";
String userName = "amar";
String password = "amar123";
Connection con = null;
try{
Class.forName(driver);
con = DriverManager.getConnection(url+db,userName,password);
try{
Statement st = con.createStatement();
String firstname=request.getParameter("empname");
String midname=request.getParameter("midname");
String lastname=request.getParameter("lastname");
String contect=request.getParameter("address");
String dob=request.getParameter("dob");
String eml=request.getParameter("email");
String position=request.getParameter("position");
String comname=request.getParameter("comname");
String salary=request.getParameter("salary");
String teleno=request.getParameter("teleno");
String mobileno=request.getParameter("mobileno");
String state=request.getParameter("state");
String city=request.getParameter("city");
int val = st.executeUpdate("insert empdetail values('"+firstname+"','"+midname+"','"+lastname+"','"+contect+"','"+dob+"','"+eml+"','"+position+"','"+comname+"','"+salary+"','"+teleno+"','"+mobileno+"','"+state+"','"+city+"')");

con.close();
out.println("success");
}
catch (SQLException ex){
System.out.println("SQL statement is not executed!");
}
}
catch (Exception e){
e.printStackTrace();
}

}
}

Answers
Hi shaziya


i am sending servlets link , read more and more information about servlet. how to compile and how to run servlets program.This is running program but you are not able. This program not give you result on command prompt.

so read for more information at :


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


Thanks.


More Questions
Post Answers
 
Ask Question Facing Programming Problem?
Useful Links
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification

Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2007. All rights reserved.