| | |
code is nopt updating the database as given below
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Oct 2007
Posts: 19
Reputation:
Solved Threads: 0
jsp code
<%@ page import="temperory.Mrityunjay.*"%>
<%@ page import="com.MindShaper.ClassTeacher.Utility.BaseServlet.VSHttpServlet" %>
<%@ page import="java.util.*"%>
<%@ page import="com.MindShaper.ClassTeacher.Utility.Helper.*" %>
<%@ page import="ClassTeacher.SessionObject"%>
<%@ page import="ClassTeacher1.MemoryTables"%>
<HTML>
<HEAD>
<TITLE>Student Information</TITLE>
<!-- for confirm () -->
<script language="JavaScript1.2" src="functions.js" type="text/javascript"> </script>
<link rel="stylesheet" href="lib.css" type="text/css">
<style type="text/css">
<!--
td {
padding-left: 15px;
}
-->
</style>
</HEAD>
<BODY>
<link rel="stylesheet" href="/utils/infrastructure/common.css" type="text/css">
<form name="input" method='get' action="/servlets/temperory.Mrityunjay.Update" >
<%
SessionObject sessObj= (SessionObject)request.getSession(false).getValue("com.MindShaper.ClassTeacher.VS.SessionObject");
if(sessObj == null) {
String errMsg = "Your Session Has Been Deactivated";
errMsg = MemoryTables.removeSpaces(errMsg);
response.sendRedirect("/servlets/ClassTeacher.GetLoginData?errMsg=" + errMsg);
return;
}
Displayname a= new Displayname();
int Id=RequestHelper.getInt(request,"Id",0);
String act = RequestHelper.getString(request,"act","");
String fname = "";
String lname ="";
String class1="";
if(act.equalsIgnoreCase("edit"))
{
a = Displayname.getbyId(Id);
fname=a.getFirstname();
lname = a.getLastname();
class1=a.getClass1();
}
%>
<table border="0" align='center' width="70%" height="20%">
<tr>
<th align=Center colspan=0></th>
</tr>
Type your first name:
<input type="text" name="FirstName" value ="<%=fname%>">
<br>
<br>Type your last name:
<input type="text" name="LastName"value= "<%=lname%>">
<br>
<br>Type your Class:
<input type="text" name="Class" value= "<%=class1%>" >
<br>
<input type="submit" value="UPDATE">
<input type="hidden" name="act" value="<%=act%>">
</form>
</BODY>
</HTML>
servlet code
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3)
// Source File Name: AddEditArea.java
package temperory.Mrityunjay;
import ClassTeacher.SessionObject;
import ClassTeacher1.MemoryTables;
import com.MindShaper.ClassTeacher.Utility.BaseServlet.VSHttpServlet;
import com.MindShaper.ClassTeacher.Utility.Helper.*;
import java.io.IOException;
import java.util.Date;
import javax.servlet.ServletException;
import javax.servlet.http.*;
// Referenced classes of package com.MindShaper.ClassTeacher.Utility.Administration.NTransport:
// NTransportDBHelper
public class Update extends VSHttpServlet
{
public Update()
{
}
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
doPost(req, res);
}
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
SessionObject sessObj1 = (SessionObject)req.getSession(false).getValue("com.MindShaper.ClassTeacher.VS.SessionObject");
if(sessObj1 == null)
{
String errMsg = "Your Session Has Been Deactivated";
errMsg = MemoryTables.removeSpaces(errMsg);
res.sendRedirect("/servlets/ClassTeacher.GetLoginData?errMsg=" + errMsg);
return;
}
Log.log("1");
String act;
act= RequestHelper.getString(req,"act","");
Log.log("2");
int Id= RequestHelper.getInt(req, "Id",0);
String fname = RequestHelper.getString(req, "FirstName", "");
String lname = RequestHelper.getString(req, "LastName", "");
String class1 = RequestHelper.getString(req, "Class", "");
String query1= "UPDATE MRITYUNJAY set Firstname = '"+StringHelper.makeDbSafe(fname)+"',Lastname = '"+StringHelper.makeDbSafe(lname)+"',Class='"+StringHelper.makeDbSafe(class1)+"' where Id= "+Id;
Log.log("3");
try
{
DBHelper.executeIt(query1);
}
catch(Exception e)
{
}
res.sendRedirect("/temp/mrityunjay/displayname.jsp");
}
}
plz help as urgent as possible
<%@ page import="temperory.Mrityunjay.*"%>
<%@ page import="com.MindShaper.ClassTeacher.Utility.BaseServlet.VSHttpServlet" %>
<%@ page import="java.util.*"%>
<%@ page import="com.MindShaper.ClassTeacher.Utility.Helper.*" %>
<%@ page import="ClassTeacher.SessionObject"%>
<%@ page import="ClassTeacher1.MemoryTables"%>
<HTML>
<HEAD>
<TITLE>Student Information</TITLE>
<!-- for confirm () -->
<script language="JavaScript1.2" src="functions.js" type="text/javascript"> </script>
<link rel="stylesheet" href="lib.css" type="text/css">
<style type="text/css">
<!--
td {
padding-left: 15px;
}
-->
</style>
</HEAD>
<BODY>
<link rel="stylesheet" href="/utils/infrastructure/common.css" type="text/css">
<form name="input" method='get' action="/servlets/temperory.Mrityunjay.Update" >
<%
SessionObject sessObj= (SessionObject)request.getSession(false).getValue("com.MindShaper.ClassTeacher.VS.SessionObject");
if(sessObj == null) {
String errMsg = "Your Session Has Been Deactivated";
errMsg = MemoryTables.removeSpaces(errMsg);
response.sendRedirect("/servlets/ClassTeacher.GetLoginData?errMsg=" + errMsg);
return;
}
Displayname a= new Displayname();
int Id=RequestHelper.getInt(request,"Id",0);
String act = RequestHelper.getString(request,"act","");
String fname = "";
String lname ="";
String class1="";
if(act.equalsIgnoreCase("edit"))
{
a = Displayname.getbyId(Id);
fname=a.getFirstname();
lname = a.getLastname();
class1=a.getClass1();
}
%>
<table border="0" align='center' width="70%" height="20%">
<tr>
<th align=Center colspan=0></th>
</tr>
Type your first name:
<input type="text" name="FirstName" value ="<%=fname%>">
<br>
<br>Type your last name:
<input type="text" name="LastName"value= "<%=lname%>">
<br>
<br>Type your Class:
<input type="text" name="Class" value= "<%=class1%>" >
<br>
<input type="submit" value="UPDATE">
<input type="hidden" name="act" value="<%=act%>">
</form>
</BODY>
</HTML>
servlet code
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3)
// Source File Name: AddEditArea.java
package temperory.Mrityunjay;
import ClassTeacher.SessionObject;
import ClassTeacher1.MemoryTables;
import com.MindShaper.ClassTeacher.Utility.BaseServlet.VSHttpServlet;
import com.MindShaper.ClassTeacher.Utility.Helper.*;
import java.io.IOException;
import java.util.Date;
import javax.servlet.ServletException;
import javax.servlet.http.*;
// Referenced classes of package com.MindShaper.ClassTeacher.Utility.Administration.NTransport:
// NTransportDBHelper
public class Update extends VSHttpServlet
{
public Update()
{
}
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
doPost(req, res);
}
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
SessionObject sessObj1 = (SessionObject)req.getSession(false).getValue("com.MindShaper.ClassTeacher.VS.SessionObject");
if(sessObj1 == null)
{
String errMsg = "Your Session Has Been Deactivated";
errMsg = MemoryTables.removeSpaces(errMsg);
res.sendRedirect("/servlets/ClassTeacher.GetLoginData?errMsg=" + errMsg);
return;
}
Log.log("1");
String act;
act= RequestHelper.getString(req,"act","");
Log.log("2");
int Id= RequestHelper.getInt(req, "Id",0);
String fname = RequestHelper.getString(req, "FirstName", "");
String lname = RequestHelper.getString(req, "LastName", "");
String class1 = RequestHelper.getString(req, "Class", "");
String query1= "UPDATE MRITYUNJAY set Firstname = '"+StringHelper.makeDbSafe(fname)+"',Lastname = '"+StringHelper.makeDbSafe(lname)+"',Class='"+StringHelper.makeDbSafe(class1)+"' where Id= "+Id;
Log.log("3");
try
{
DBHelper.executeIt(query1);
}
catch(Exception e)
{
}
res.sendRedirect("/temp/mrityunjay/displayname.jsp");
}
}
plz help as urgent as possible
Error messages and stack traces would help.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
I'm sorry, but that says it all.
The application server you are using to server these pages has a log. The errors should be found there. And I said nothing about a "code trace". I said a "stack trace", these should also be in the log file, probably directly after the error message, as long as the application server is not configure to prevent them.
The application server you are using to server these pages has a log. The errors should be found there. And I said nothing about a "code trace". I said a "stack trace", these should also be in the log file, probably directly after the error message, as long as the application server is not configure to prevent them.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
![]() |
Similar Threads
- Problem connecting to the database after changing the database server (ASP.NET)
- search code not working!!! (VB.NET)
- Writing to an Access Database (Visual Basic 4 / 5 / 6)
- Beginner: how to add new record into database??? (VB.NET)
- Deleting the database rows and adding new rows (Visual Basic 4 / 5 / 6)
- updating a database (ASP.NET)
- jsp code to send values to database (JSP)
- Error connecting to database (ASP.NET)
- Database not being populated.... (Java)
- storing references to classes (C++)
Other Threads in the Java Forum
- Previous Thread: cannot find symbol error message
- Next Thread: compiler errors wargame
| Thread Tools | Search this Thread |
Tag cloud for Java
addressbook android api apple applet application arguments array arrays automation binary bluetooth button calculator chat class classes client code columns component converter database draw eclipse error errors event exception file fractal ftp game givemetehcodez graphics gridlayout gui helpwithhomework html ide image inetaddress input integer j2me japplet java javaprojects jme jmf jni jpanel julia link linux list loop map method methods midlethttpconnection mobile netbeans newbie number objects openjavafx oracle php print problem program programming project projects recursion rim scanner screen server set signing size smart sms socket sort sql storm string support swing test threads time tree unlimited variablebinding webservices windows






