type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 34 in the jsp file: /job_link_insert.jsp
Syntax error, insert "AssignmentOperator Expression" to complete Assignment

<%@ page import="java.sql.*"%>

<%
//String id=request.getParameter("idno");

try
{

An error occurred at line: 34 in the jsp file: /job_link_insert.jsp
Syntax error, insert ";" to complete BlockStatements
<%@ page import="java.sql.*"%>

<%
//String id=request.getParameter("idno");

try
{

Am stuck and I have looked at the code in the last 5 hours and I can't find any error...Please need urgent help

Recommended Answers

All 10 Replies

not urgent.
And had you used proper coding techniques instead of scriptlets you'd never had had this problem in the first place.

I still need help on the error I am getting....Anyone who can help please assist...Am new in java programming
Jweting....what's the proper coding I should have used...

The proper way to go about the task would have been to use JSTL or JSF instead of scriptlets. The official J2EE tutorial would be a good starting point. Plus what you posted was far from useful; you need to post the entire relevant code instead of just the line which is flagging an error.

Could someone help me trace tthe cause of the above error:

Find below the entire code:

<HTML>
<HEAD>
<TITLE>HELB - Job Link</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD><BODY BGCOLOR=#FFFFFF leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="">
<form name="form1" action="helb_jobs.jsp" method="post"> 
  <div align="center"> 
<table width="780" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" height="100%" align="center"> 
<tr valign="top"> <td height="0"> <div align="center"> <table width="780" border="0" cellspacing="0" cellpadding="0"> 
<tr> <td><img src="images/topstrip.gif" width="780" height="85" usemap="#MapMap" border="0"><map name="MapMap"><area shape="rect" coords="661,69,703,84" href="index.jsp" alt="Home" title="Home"><area shape="rect" coords="720,69,767,84" href="helb_sitemap.html" alt="Sitemap" title="Sitemap"></map></td></tr> 
</table><table width="780" border="0" cellspacing="0" cellpadding="0"> <tr bgcolor="f5f5f5"> 
<td height="18"> 
                  <div align="center"><font face="Arial, Helvetica, sans-serif" size="2" color="#FF0000"><marquee scrollamount="3"><b>Are 
                You a Loanee? Please repay your loan to enable a needy student 
                to pursue higher education</b></marquee></font></div>
                </td></tr> </table><table width="780" cellspacing="0" cellpadding="0" height="50%"> 
<tr> <td valign="top">&nbsp;</td><TD ROWSPAN="2" VALIGN="top" HEIGHT="222" WIDTH="225"> 
<DIV ALIGN="right"><IMG SRC="images/helb_2.jpg" WIDTH="225" HEIGHT="301"></DIV></TD></tr> 
<tr>
  <td HEIGHT="50" valign="top"><table width="100%" cellspacing="0" cellpadding="0">
    <tr>
      <td height="2"><div align="center">
        <P>&nbsp;</P>
        <P>&nbsp;</P>
      </div></td>
    </tr>
    <tr>
      <td><div align="center">
        <%@ page import="java.sql.*"%>
 
<%
//String id=request.getParameter("idno");

try
{
String dbhost="2ntserver";
String mysid="NTDB";
String username="test";
String password="test";
//Load driver
Class.forName("oracle.jdbc.driver.OracleDriver");
//Connection information
String url="jdbc:oracle:thin:@" + dbhost + ":1521:" + mysid;
//Username and password
Connection con=DriverManager.getConnection(url,username,password);
//Statement stmt=con.createStatement();

//create statement


String myid=request.getParameter("idno");
session.setAttribute("sidno",request.getParameter("idno"));
String myidlname=request.getParameter("idlname");
session.setAttribute("sidlname",request.getParameter("idlname"));
String myidfname=request.getParameter("idfname");
session.setAttribute("sidfname",request.getParameter("idfname"));
String myidmname=request.getParameter("idmname");
session.setAttribute("sidmname",request.getParameter("idmname"));
String mygender=request.getParameter("gender");
session.setAttribute("sgender",request.getParameter("gender"));
String mydob=request.getParameter("dob");
session.setAttribute("sdob",request.getParameter("dob"));
String myemail=request.getParameter("email");
session.setAttribute("semail",request.getParameter("email"));
String mycell_phone=request.getParameter("cell_phone");
session.setAttribute("cell_phone",request.getParameter("cell_phone"));
String myinstitution_type1=request.getParameter("institution_type1");
session.setAttribute("sinstitution_type1",request.getParameter("institution_type1"));
String mygrade1=request.getParameter("grade1");
session.setAttribute("sgrade1",request.getParameter("grade1"));
String mycountry1=request.getParameter("country1");
session.setAttribute("scountry1",request.getParameter("country1"));
String myinstitution_name1=request.getParameter("institution_name1");
session.setAttribute("sinstitution_name1",request.getParameter("institution_name1"));
String myperiod_of_study_from1=request.getParameter("period_of_study_from1");
session.setAttribute("speriod_of_study_from1",request.getParameter("period_of_study_from1"));
String myperiod_of_study_to1=request.getParameter("period_of_study_to1");
session.setAttribute("speriod_of_study_to1",request.getParameter("period_of_study_to1"));
String myinstitution_type2=request.getParameter("institution_type2");
session.setAttribute("sinstitution_type2",request.getParameter("institution_type2"));
String mygrade2=request.getParameter("grade2");
session.setAttribute("sgrade2",request.getParameter("grade2"));
String mycountry2=request.getParameter("country2");
session.setAttribute("scountry2",request.getParameter("country2"));
String myinstitution_name2=request.getParameter("institution_name2");
session.setAttribute("sinstitution_name2",request.getParameter("institution_name2"));
String myperiod_of_study_from2=request.getParameter("period_of_study_from2");
session.setAttribute("speriod_of_study_from2",request.getParameter("period_of_study_from2"));
String myperiod_of_study_to2=request.getParameter("period_of_study_to2");
session.setAttribute("speriod_of_study_to2",request.getParameter("period_of_study_to2"));
String myinstitution_type3=request.getParameter("institution_type3");
session.setAttribute("sinstitution_type3",request.getParameter("institution_type3"));
String mygrade3=request.getParameter("grade3");
session.setAttribute("sgrade3",request.getParameter("grade3"));
String mycountry3=request.getParameter("country3");
session.setAttribute("scountry3",request.getParameter("country3"));
String myinstitution_name3=request.getParameter("institution_name3");
session.setAttribute("sinstitution_name3",request.getParameter("institution_name3"));
String myperiod_of_study_from3=request.getParameter("period_of_study_from3");
session.setAttribute("speriod_of_study_from3",request.getParameter("period_of_study_from3"));
String myperiod_of_study_to3=request.getParameter("period_of_study_to3");
session.setAttribute("speriod_of_study_to3",request.getParameter("period_of_study_to3"));
String myinstitution_type4=request.getParameter("institution_type4");
session.setAttribute("sinstitution_type4",request.getParameter("institution_type4"));
String mygrade4=request.getParameter("grade4");
session.setAttribute("sgrade4",request.getParameter("grade4"));
String mycountry4=request.getParameter("country4");
session.setAttribute("scountry4",request.getParameter("country4"));
String myinstitution_name4=request.getParameter("institution_name4");
session.setAttribute("sinstitution_name4",request.getParameter("institution_name4"));
String myperiod_of_study_from4=request.getParameter("period_of_study_from4");
session.setAttribute("speriod_of_study_from4",request.getParameter("period_of_study_from4"));
String myperiod_of_study_to4=request.getParameter("period_of_study_to4");
session.setAttribute("speriod_of_study_to4",request.getParameter("period_of_study_to4"));
String myinstitution_type5=request.getParameter("institution_type5");
session.setAttribute("sinstitution_type5",request.getParameter("institution_type5"));
String mygrade5=request.getParameter("grade5");
session.setAttribute("sgrade5",request.getParameter("grade5"));
String mycountry5=request.getParameter("country5");
session.setAttribute("scountry5",request.getParameter("country5"));
String myinstitution_name5=request.getParameter("institution_name5");
session.setAttribute("sinstitution_name5",request.getParameter("institution_name5"));
String myperiod_of_study_from5=request.getParameter("period_of_study_from5");
session.setAttribute("speriod_of_study_from5",request.getParameter("period_of_study_from5"));
String myperiod_of_study_to5=request.getParameter("period_of_study_to5");
session.setAttribute("speriod_of_study_to5",request.getParameter("period_of_study_to5"));
String mybrief_cv=request.getParameter("brief_cv");
session.setAttribute("sbrief_cv",request.getParameter("brief_cv"));
String myprofession=request.getParameter("profession");
session.setAttribute("sprofession",request.getParameter("profession"));
String myuncode1=request.getParameter("uncode1");
session.setAttribute("suncode1",request.getParameter("uncode1"));
String myuncode2=request.getParameter("uncode2");
session.setAttribute("suncode2",request.getParameter("uncode2"));
String myuncode3=request.getParameter("uncode3");
session.setAttribute("suncode3",request.getParameter("uncode3"));
String myuncode4=request.getParameter("uncode4");
session.setAttribute("suncode4",request.getParameter("uncode4"));
String myuncode5=request.getParameter("uncode5");
session.setAttribute("uncode5",request.getParameter("uncode5"));
String myother_un1=request.getParameter("other_un1");
session.setAttribute("other_un1",request.getParameter("other_un1"));
String myother_un2=request.getParameter("other_un2");
session.setAttribute("sother_un2",request.getParameter("other_un2"));
String myother_un3=request.getParameter("other_un3");
session.setAttribute("sother_un3",request.getParameter("other_un3"));
String myother_un4=request.getParameter("other_un4");
session.setAttribute("sother_un4",request.getParameter("other_un4"));
String myother_un5=request.getParameter("other_un5");
session.setAttribute("sother_un5",request.getParameter("other_un5"));

PreparedStatement updatejob=con.prepareStatement("Insert into pot_employee (idno,idlname,idfname,idmname,gender,dob,email,cell_phone,institution_type1,institution_type2,institution_type3,institution_type4,institution_type5,grade1,grade2,grade3,grade4,grade5,country1,country2,country3,country4,country5,institution_name1,institution_name2,institution_name3,institution_name4,institution_name5,period_of_study_from1,period_of_study_from2,period_of_study_from3,period_of_study_from4,period_of_study_from5,period_of_study_to1,period_of_study_to2,period_of_study_to3,period_of_study_to4,period_of_study_to5,brief_cv,profession,uncode1,uncode2,uncode3,uncode4,uncode5,other_un1,other_un2,other_un3,other_un4,other_un5) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
updatejob.setString(1,myid);
updatejob.setString(2,myidlname);
updatejob.setString(3,myidfname);
updatejob.setString(4,myidmname);
updatejob.setString(5,mygender);
updatejob.setString(6,mydob);
updatejob.setString(7,myemail);
updatejob.setString(8,mycell_phone);
updatejob.setString(9,myinstitution_type1);
updatejob.setString(10,myinstitution_type2);
updatejob.setString(11,myinstitution_type3);
updatejob.setString(12,myinstitution_type4);
updatejob.setString(13,myinstitution_type5);
updatejob.setString(14,mygrade1);
updatejob.setString(15,mygrade2);
updatejob.setString(16,mygrade3);
updatejob.setString(17,mygrade4);
updatejob.setString(18,mygrade5);
updatejob.setString(19,mycountry1);
updatejob.setString(20,mycountry2);
updatejob.setString(21,mycountry3);
updatejob.setString(22,mycountry4);
updatejob.setString(23,mycountry5);
updatejob.setString(24,myinstitution_name1);
updatejob.setString(25,myinstitution_name2);
updatejob.setString(26,myinstitution_name3);
updatejob.setString(27,myinstitution_name4);
updatejob.setString(28,myinstitution_name5);
updatejob.setString(29,myperiod_of_study_from1);
updatejob.setString(30,myperiod_of_study_from2);
updatejob.setString(31,myperiod_of_study_from3);
updatejob.setString(32,myperiod_of_study_from4);
updatejob.setString(33,myperiod_of_study_from5);
updatejob.setString(34,myperiod_of_study_to1);
updatejob.setString(35,myperiod_of_study_to2);
updatejob.setString(36,myperiod_of_study_to3);
updatejob.setString(37,myperiod_of_study_to4);
updatejob.setString(38,myperiod_of_study_to5);
updatejob.setString(39,mybrief_cv);
updatejob.setString(40,myprofession);
updatejob.setString(41,myuncode1);
updatejob.setString(42,myuncode2);
updatejob.setString(43,myuncode3);
updatejob.setString(44,myuncode4);
updatejob.setString(45,myuncode5);
updatejob.setString(46,myother_un1);
updatejob.setString(47,myother_un2);
updatejob.setString(48,myother_un3);
updatejob.setString(49,myother_un4);
updatejob.setString(50,myother_un5);

updatejob.executeUpdate();

//response.sendRedirect("http://localhost/form_insert_success.html");
//response.sendRedirect("http://localhost/servlet/Gen_pdf?theid=" + myid);
}
catch(Exception e)
{


e
//response.sendRedirect("http://localhost/record_exist.html");
}
%>

      </div></td>
    </tr>
  </table></td>
</tr> </table>
</div></td></tr> 
<tr bgcolor="#336699"> <td height="1"><img src="images/1x1trans.gif" width="600" height="1"></td></tr> 
</table></div></form>
</BODY>
</HTML>

nope. You still haven't done what you were told.
And now you're posting reams of unformatted code as well, another mortal sin.

If you can't help, why dont you just shut up. you are not any helpful

noone's going to help you with that attitude, kiddo...

> If you can't help, why don't you just shut up. you are not any helpful

Insulting forum regulars / contributors is a sure shot way of driving away all help you could have got. Please refrain from such activities.

As far as your problem is concerned, you still haven't shown an indication of integrating the changes suggested in my previous post. Plus I see a hanging 'e' in your catch block which is probably the cause of your problem. This is a pretty basic thing which should have been easy to pick up; maybe you need to go back to the basics of Java programming and dive into J2EE once you are confident of tackling the Java related issues. A document which aids the beginners in finding the reason for some common compile and runtime errors can be found here.

Was just searching for some answers to some similar coding problem and ran across this post. Turns out this has nothing to do with what I was looking for but I was intrigued by the abuse that one poor soul suffered at the hands of one of your forum guru. Not that anyone will read this but this forum sucks. Who wants to have trouble and go to a forum that is supposed to help just to have someone tell you that you are stupid. The person looked for hours and was frantic. Even if he didn't follow the proper protocols for posting and asking for help he is still a person that needs help. It's like you people think you are better than someone else because you know something about coding (or think you know something about coding). The time and energy you spent beating this person up could have been spent fixing the problem.

Oh here you have a hanging e, that should fix it. By the way you did not follow proper posting protocols. In the future please follow these rules <URL SNIPPED>.

What ever coding knowledge any of us have is insignificant to the amount of total useful knowledge out there. What one fool can do another cannot... Don't be so high and mighty about ones and zeros.

Not that there is a better business bureau for help forums but just thought I'd say I'll never come to this site for help.

Rebellious much?

The OP made the mistake of:
* Labeling the question as urgent which implies his/her question is more important than someone else's personal life
* Posting stuff which can't be tested by someone else (you see that database code, right?)
* Ignoring suggestions already posted or at least no responding to them

The aim of this forum is to provide answers and help folks learn. If all you want is to dump some 1000 line code and expect people to fix it, then there are paid homework services out there.

That being said, your post is unjust because it evaluates the entire thread based on the view point of the one asking for help but ignores the view point of those rendering it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.