Abhijeet Neware

Greenhorn
+ Follow
since Mar 28, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Abhijeet Neware



Dear friends

I am newbie to struts 1.2 and going to create simple example that insert the values into tables i write following simple Action servlet but it didn't work please tell
me or suggest me changes in that file


package com.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.*;
import org.apache.struts.actions.*;

import com.form.WorkOrderForm;
import java.sql.*;

import utility.ProjectUtility;

public class WorkOrderAction1 extends Action
{
String WONum=null,WODate=null;
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)throws Exception
{
javax.sql.DataSource dataSource;
java.sql.Connection myConnection=null;
try
{
dataSource = getDataSource(request);
myConnection = dataSource.getConnection();
Statement stmt=myConnection.createStatement();

WorkOrderForm woForm = (WorkOrderForm) form;
WONum=woForm.getwoNum();
WODate=woForm.getwoDate();
System.out.println("WONum : "+WONum);
System.out.println("WODate : "+WODate);
//String qry="insert into complete_erp.tbl_1_workorder (workorderno,wo_date) values('"+WONum+"','"+WODate+"')";
//int i=stmt.executeUpdate("insert tbl_1_workorder (workorderno,wo_date) values('"+WONum+"','"+WODate+"')");
int i=stmt.executeUpdate("insert into workorder (workorder_no,workorderDate) values('"+WONum+"','"+WODate+"')");
System.out.println(""+i);
stmt.close();
if(i==1)
{
return mapping.findForward("success");
}
else
{
return mapping.findForward("failure");
}
//stmt.executeUpdate(qry);
//System.out.println("execute"+stmt.executeUpdate(qry));

}
catch(SQLException sqle)
{
getServlet().log("Connection.process", sqle);
}
finally
{
//enclose this in a finally block to make
//sure the connection is closed
try
{
myConnection.close();
}
catch (SQLException e)
{
getServlet().log("Connection.close", e);
}

}
return mapping.findForward("failure");
}
}
12 years ago


Dear friends;

Please help me, tell me how to call applet from jsp?
12 years ago
Dear Friends;


Please tell me how call applet from jsp?
12 years ago
dear freinds;

How to call the applet from jsp?


Regards
Abhijeet
12 years ago

hello friends,

I have form that submits the value in the database now i want submitted value should be display on the same jsp page how i do this? please help me..





12 years ago
JSP


Hello

What is difference between web server and application server?
Does the tomcat work without apache?
12 years ago

Hi friends

Can any me suggets how to convert doc file into java using java?
12 years ago
hi;

We are developing a project it just having JSP and Servlet, but we have to modify that project by implementing MVC design pattern
please suggest me how to do that. That project contains JSP for view and in backend all servlets are working.
12 years ago
JSP
Where we can find the servlet chaining is beneficial in our application?
12 years ago
jsp

Amit Ghorpade wrote:IDEs like Netbeans allow you to see the generated servlet, but there is no much point looking at the generated code, a better alternative is look at the JSP you are writing and forget how its processed.



hey dear,
I know that, but uou have to know whats happening in back end, I face this question in interview thats why i am asking...
12 years ago
JSP
jsp

Bear Bibeault wrote:Bear in mind that putting scriptlets and declaration into a JSP is a bad practice that has been discredited for almost ten years now. You should be concentrating your JSP learning on modern techniques, not outdated poor practices.



Thanks dear;
but i didn't get you properly, if we didn't write a scriplet in jsp so where we write a java code in jsp, can please explain me...
12 years ago
JSP
Please help me out finding the answer of following question

What is ServletContext and ServletConfig?
12 years ago
This question is confused me every time so guide me someone please.....
Difference between ServletConfig and ServletContext
12 years ago
jsp
Thanks Raj.... but i am using weblogic sever, can you tell me in weblogic serve where the translated servlet is located.
12 years ago
JSP
jsp
hi........ i am new on this forum and new in java technlogy so please help me i want to learn jsp and servlet deeply so please give answer of my question i'm trying but i didn't get the answer...
As jsp is translated in servlet, can anyone tell me where the declaration part of jsp and scriplet part of jsp goes in servlet after its translation in servlet
12 years ago
JSP