Error!Urgent!Pls Help.....Thank You
I had the following error with the code below.......anyone pls help me ..... urgent.....I will be really appreciate it......Thank you in advanced.....
I had created two statement,.....one is to select the value of Leave_Reason from a table and store it in the String Leave_Reason after that I need to insert the Leave_Reason variable's value together with other value which input from a form in the previous page....into another table....
But I dun know why I encountered the error below....anyone pls help.....really urgent.....I had tried to solve it for two days already,,,,,
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 86 in the jsp file: /SilkAir/leave_request.jsp
Generated servlet error:
[javac] Compiling 1 source file
C:\Tomcat 4.1\work\Standalone\localhost\_\SilkAir\leave_request_jsp.java:315: cannot resolve symbol
symbol : variable Leave_Reason
location: class org.apache.jsp.leave_request_jsp
String Query = "INSERT INTO Leave_Application (Emp_Num, Leave_ID, Apply_Date, Leave_Date, Leave_Reason, Leave_Applied, Leave_Status) VALUES ('" + Emp_Num + "', '" + Leave_ID + "', '" Apply_Date "', '" + Leave_Date + "', '" + Leave_Reason + "', '" + Day + "', 'Pending')";
^
1 error
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:130)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:340)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:352)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:474)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:184)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
at java.lang.Thread.run(Thread.java:536)
<request.jsp>
<%@page import="java.sql.*"%>
<%@page import="java.util.Date"%>
<%@page import="java.text.SimpleDateFormat"%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<%
String username = (String)session.getAttribute("username");
%>
<%
//define connection
Connection con = null;
try{
//get the class
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
//get the connection
con = DriverManager.getConnection("jdbc:odbc:Database","","");
//please catch your exceptions!
catch(Exception e){
out.println(e.getMessage());
// form data
String Emp= request.getParameter("txtEmp");
String Leave_ID = request.getParameter("txtReason");
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy/MM/dd");
String LeaveDate = request.getParameter("txtLeaveDate");
java.util.Date dateU = sdf.parse(LeaveDate);
java.sql.Date Leave_Date = new java.sql.Date(dateU.getTime());
String Day = request.getParameter("txtDay");
java.text.SimpleDateFormat rd = new java.text.SimpleDateFormat("yyyy/MM/dd");
String ApplyDate = request.getParameter("txtApplyDate");
java.util.Date dateR = rd.parse(ApplyDate);
java.sql.Date Apply_Date = new java.sql.Date(dateR.getTime());
// query statement
ResultSet rs=null;
Statement SQLStatement = con.createStatement();
Statement stm = con.createStatement();
String query = "SELECT DISTINCT LeaveType FROM Leave WHERE Leave_ID ='"+Leave_ID+"'";
rs = stm.executeQuery(query);
if(rs.next())
String Leave_Reason = rs.getString("LeaveType");
else
{ out.println("no results found");
rs.close();
stm.close();
String Query = "INSERT INTO Application (Emp, Leave_ID, Apply_Date, Leave_Date, Leave_Reason, Leave_Applied, Leave_Status) VALUES ('" + Emp_Num + "', '" + Leave_ID + "', '" Apply_Date "', '" + Leave_Date + "', '" + Leave_Reason + "', '" + Day + "', 'Pending')";
// get result code
int SQLStatus = SQLStatement.executeUpdate(Query);
if(SQLStatus != 0)
out.println("post successfully.");
else
out.println("Problem encountered");
// close connection
SQLStatement.close();
con.close();
%>
</body>
</html>
if(rs.next())
String Leave_Reason = rs.getString("LeaveType");
else
{ out.println("no results found");
rs.close();
stm.close();
String Query = "INSERT INTO Application (Emp, Leave_ID, Apply_Date, Leave_Date, Leave_Reason, Leave_Applied, Leave_Status) VALUES ('" + Emp_Num + "', '" + Leave_ID + "', '" Apply_Date "', '" + Leave_Date + "', '" + Leave_Reason + "', '" + Day + "', 'Pending')";
The Problem is that the variable Leave_Reason is declared as a local variable inside a if block. So the scope of the variable is not visible outside the if block...
Try using something like
String Leave_Reason = "";
if(rs.next())
Leave_Reason = rs.getString("LeaveType");
else
{ out.println("no results found");
This should work...
Hope it helps.
Thanks and regards,
Pazhanikanthan. P
Similar Messages
-
hi,
I DOWNLOADED IOS 7 in my daughters ipad and now i cant open it. the screen shows only usb and an itunes icon. pls help she need it for her games. thank you.DUPLICATE POST
Please see: https://discussions.apple.com/thread/5513386?tstart=0 -
heloo... How can i switch my ipod 4thgen to philippine store since it is currently set to canada store so i can make download thank you
These will help you I hope.
http://support.apple.com/kb/ht1311
https://discussions.apple.com/thread/4514753?start=0&tstart=0
http://www.ilounge.com/index.php/articles/comments/switching-an-itunes-store-acc ount-to-a-different-country/ -
Hi,can anyone tell me how to fix error 4261, please help, thank you
Would be most grateful for some help, as I can't burn onto disc,
thank youClose iTunes
Right -click on the iTunes Library.itl file (located in My Music\iTunes)
Properties
Security
Edit
Add
Type "everyone"
Ok
select "everyone" from the list and check full control in the allow column
Apply
OK
Open iTunes and try again -
I've added an aps to my I tune and it asked me to change from ok to USA, so I have done this. I am now unable to have any new aps as it keeps saying my I tunes is USA and I need to change it back to uk. I have looked at account and it is showing a GB logo and not USA. Can any one advise me on how to get my I tunes account back to uk please.
I recently had a 32gb iphone 4 I backed up the phone via cable to my pc and when I tried to sync the 16gb iphone 5 no apps synced and some other data as well there was an error message saying there is not enough room. there is plenty of room on the new phone for apps, is there any way i can access the photos and apps that are on my pc? I am mainly concerned about my photos. Do I have to buy a 32gb phone now?
-
I have iPhone 6, 8.3. I cannot use bluetooth at all from my device, even to connect my macbook pro. I did all the recommended trouble shooting such as reboot and reset network settings. but it does not recognise any bluetooth device. Pls help.Thank you.
See iPhone BT profile on what can be connected/paired:
iOS: Supported Bluetooth profiles - Apple Support
And BT troubleshooting:
iOS: Troubleshooting Bluetooth connections - Apple Support -
hello apple.help me network iphone 4 use ios7.12 error network.acoount icloud.apple please help support errors no service network.thank you
<Personal Information Edited by Host>tran ngoc nhan,
Viết bằng tiếng mẹ đẻ của bạn?
Tôi đoán Việt Nam?
Chúng tôi có thể dịch!
Nói cho tất cả vấn đề của bạn!
Cung cấp cho nhiều chi tiết!
Nếu không Việt Nam, dịch này ở đây!
https://translate.google.com/
Write in your native language?
I guess Vietnamese?
We can translate!
Tell all your problem!
Give much detail!
If not Vietnamese, translate this here!
https://translate.google.com/
CCC -
I am from South Africa and the itune store only allows the purchase of some music , whenever i try to buy Jesus Culture- Everything . an error message comes up "only availble in US " , PLEASE HELP .Thank you
I had the same issue this morning downloading a pre-order of Alanis, Flavors of Entanglement . I noticed that the only thing that had changed fro me was that I had some song credits for purchasing ticketmaster tickets over the past few weeks. When I went ahead and spent my remaining credits... it downloaded with no prompting or trouble. Maybe the credits issues hangs it up?
-
My songs dont download properly when it comes up it shaded in grey and it says error anyone pls help, My songs dont download properly when it comes up it shaded in grey and it says error anyone pls help
Im on ipod 6.1.3 non jaillbroken
and i have not bought songs from itunes storeWhat is the wording of the error message?
When you say download do yo mean:
- directly downloading from iTunes?
- Syncing to computer? -
on 15/12/2012 i send iphone 4s adapter to digi klang for Warranty. until today digi center still talk to me go back home and waiting.pls help
Thank.This is a USER to User technical Forum
There is no Apple presence on this forum
So nothing anyone here can do
As this is a public World wide Public forum I suggest you remove the document you have strangely decided to copy above .It looks like some form ID card -
Pls help thank a
Check your email account you set up in your Apple ID profile. Check spam and junk folders in case the email got trapped in there.
-
My iphone 3g got stuck with the apple logo and loading bar since last night when i try to reset the iphone pls help thanks!
Can you reset the phone by holding the on/off switch and home button down until your phone reboots and the Apple logo again displays?
-
Hello, I wonder is there any additional charges applied after I removed my credit card info? I was being charged but i can't login to itunes couldn't check what items was being charged in this case. Anyone pls help, thanks.
When the regular customer service reps fail, try one of these:Send an email to the team at "[email protected]". Include:
Account number
Full name
Service address
Best contact phone number and best time to call
A description of the problem
One of their problem resolution specialists should contact you to follow up, usually by phone. They seem to be quite a bit sharper than the regular customer service reps.-OR-Use the feedback form at http://customer.xfinity.com/help-and-support/vp-contact-form.You might also try Twitter (https://twitter.com/ComcastCares/) and Facebook (https://www.facebook.com/Xfinity).
Comcast sometimes responds to questions here in the forums, and sometimes they do not. When they do the typical response time is somewhere between a few hours and a few days. -
Hi, purchased a I phone5s last evening, had to change it today due to a hardware issue, got a replacement unit which comes in the white box, is it a brandnew device or a refurbished device, really worried, pls help thanks..
Hi, if you bought the product brand new and was provided to you defective, you must be provided with a brand new replacement. Furthermore, if anyone provides refurbished phones, it must clearly state this either on the box or in the paperwork for that phone.
-
hello, I'm using the same apple id on my Ipad and Iphone, and anything i do and my ipad reflects on my iphone. if i download an app on my iphone it also downloads on my ipad. Can i stop this from happening. i need help. thank you.
Yes, under the Settings for the store, you can turn off the auto download for purchases, that way if you purchase an app on another device it will not automatically download on that device. You would need to do this on both your iPad and iPhone.
-
Hi, I'm unable to use my speaker when I'm using Mac OS, which means I'm unable to unmute, decrease or increase the volume. However, I'm able to do so for Windows 7 OS on Bootcamp. Can anyone please advise on how to rectify this problem? I would greatly appreciate your help, thank you.
Hi Zac, sorry to hear about your troubles, but that's why us other users are here to try to help in these instances.
Open Console in Utilities & see if there are any clues or repeating messages when this connection drop happens.
Maybe you are looking for
-
ALV GRID OUTPUT PROBLEM.
here i m sending code for u r reviews. i have two tables: pa0002, zfm_handy i have to display alv grid by using these tables, i m getting output but the fields in the table pa0002(nachn,vorna) r not populated i m getting output for the fields those w
-
Forced to use Clear Text Passwords for OD binding
Running a Tiger Server 10.4.11 as OD master with one Replica. When binding clients to server in Directory Access/LDAPv3, If I "disable Clear Text Passwords," the users can not login. Uncheck this option, everything works fine. Non "Clear Text" passwo
-
How to terminate background job for MRP
Hi dudes, how to terminate background job set earlier and i want start again with fresh scheduling. as user discontinued using the MRP process. thanks inadvance for quick response. Robert.
-
Can a page-turning SWF to PDF have navigation?
I'm working on creating a flip-book PDF which needs a Replay button or some other way to get back to the first page OTHER than laboriously clicking back through every single page. In CS4 InDesign, files with Page Turn transistion must be exported as
-
What is iMessage error code:0732-3334-3378?
What is iMessage error code:0732-3334-3378? Does this mean that iMessage is not supported on my late 2008 MacBook?