954,574 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

inser data into database

i am using jsp to create web site. How can i insert data into database but do not have text box in the web site. i want to have data automatically show in the database without having people key in data from web site. the purpose for doing this is i want to generate default answer for every member.

jilshi
Newbie Poster
7 posts since Apr 2004
Reputation Points: 10
Solved Threads: 0
 

<%@ page contentType="text/html" %>
<%@ page session="true" %>
<%@ page language="java" %>
<%@ page autoFlush="true" import="com.hurix.mhlncms.*, java.util.*"%>
<%@ page import="java.util.*,java.io.*"%>

Management Information System

<%
mis.setHurixDbconnection(hdbc);
String empider=request.getParameter("empid") != null ? request.getParameter("empid") :"";
String flag=request.getParameter("flag") != null ? request.getParameter("flag") :"";
String noofhours=request.getParameter("noofhours") != null ? request.getParameter("noofhours") :"";
String empider1=request.getParameter("empid") != null ? request.getParameter("empid") :"";
String redays=request.getParameter("redays") != null ? request.getParameter("redays") :"";
String leavereqfrom=request.getParameter("leavereqfrom") != null ? request.getParameter("leavereqfrom") :"";

String flag1="hurix";

String empid ="";

String empdateofjoin = "";
String emplocation = "";
String empname ="";
String empdesignation="";
String empdepartment ="";
String empteleno ="";
String empmobileno ="";
String projectpref ="";
String mementereddate ="";

%>



 
Leave Form
 






 
 
Memberer Code

--Please Choose--


<%
Collection empid1 = mis.fetchempid();

if (empider==null){
if (empid1 != null)
{
Iterator itr1 = empid1.iterator();
Vector vpsid = new Vector();
while(itr1.hasNext())
{
vpsid = (Vector)itr1.next();%>
><%=vpsid.elementAt(0).toString()%>
<%}
}
}
else{
if (empid1 != null)
{
Iterator itr1 = empid1 .iterator();
Vector vpsid = new Vector();
while(itr1.hasNext())
{
vpsid = (Vector)itr1.next();
if((vpsid .elementAt(0).toString()).equals(empider)){%>
><%=vpsid.elementAt(0).toString()%>
<%}
else{%>
><%=vpsid.elementAt(0).toString()%>
<%}
}
}
}%>

<% if(flag.equals("1"))
{
Collection colEmpComdet = mis.fetchleavedetails1(empider);
if (colEmpComdet != null)
{
Iterator iter1 = colEmpComdet.iterator();
Vector vectcom = new Vector();
while(iter1.hasNext())
{
vectcom= (Vector)iter1.next();
empdateofjoin= vectcom.elementAt(0).toString();
emplocation=vectcom.elementAt(1).toString();
empname=vectcom.elementAt(2).toString();
empteleno=vectcom.elementAt(3).toString();
empmobileno=vectcom.elementAt(4).toString();
empdesignation=vectcom.elementAt(5).toString();
empdepartment=vectcom.elementAt(6).toString();

}
}
}

%>

<% if (flag.equals("1")){
%> <%}
%>

DateofJoin

 
Employee Name

<% if(!emplocation.equals("null")) { %>

Location


<% }
else {
%>

Location


<% } %>

 
Designation


Department
 
NoofHours*
<%=noofhours%> HALFDAY FULLDAY

Extentionno <% if(noofhours.equals("Halfday")) { //flag1="value"; %>   Mention the session ---Please Choose---- Morning Afternoon Session Date Pick a date



<% }%>

<% if(noofhours.equals("FULLday")) {
// flag1="value";
%>

  Leave Requirement From Pick a date

Leave Requirement To Pick a date   NoofDays <% }%>

  Compensatory Off From Pick a date

No of Hours --01234 HRS   In lieu of Days worked From Pick a date

No of Hours
--01234 HRS  
Type of Leave*
--Please Choose-- PrivilegePaternityContingencySick


<% if(!empteleno.equals("null")){ %>
TelePhoneno

<% }
else
{ %>
TelePhoneno

<%}%>

<% if(!empmobileno.equals("null")){ %>
 

Mobileno

<% }
else
{ %>
 

Mobileno

<%}%>

Address while of leave
 
Reason for leave*

Member’s EnteredDate


value="<%= vect.elementAt(0).toString()%>"<%
}
}
%>>
 
Approved Head*
--Please Choose-- BALAMURUGAN

Authorised By*
--Please Choose--SANGERBASKER 
Remaining Days
 





value="<%= vect.elementAt(0).toString()%>"<%
}
}
%>>

<% String aa =""; String aa1 ="";
Collection colSysdate2 = mis.fetchnoofdays(empider1);

if (colSysdate2 != null)
{
Iterator iter2 = colSysdate2.iterator();
Vector vect = new Vector();
while(iter2.hasNext())
{
vect = (Vector)iter2.next();
aa=vect.elementAt(0).toString();

}
}

if(!aa.equals("null"))
{%>

<% } else {%>
<% }

Collection colSysdate3 = mis.fetchsessionleavedays(empider1);
if (colSysdate3 != null)
{
Iterator iter3 = colSysdate3.iterator();
Vector vect = new Vector();
while(iter3.hasNext())
{
vect = (Vector)iter3.next();
aa1=vect.elementAt(0).toString();

}
}

if(!aa1.equals("null"))
{%>

<% } else {%>
<% } %>




hidash_in
Junior Poster in Training
86 posts since Oct 2007
Reputation Points: 1
Solved Threads: 0
 

Stop posting code everywhere. Especially this stuff. And then you don't even take the time (or, maybe, have the common sense) to use code tags when you do, which only compounds the "wrongness" (both the idea and the code itself) of it.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You