Hello,
I am working with
java again after a several year layoff and wonder if things have changed that much...
From a
jsp, I am calling a class method and the server is bombing on (what I would think to be) a simple
string concatenation.
Here is the full error:
Apr 3, 2005 7:06:30 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for
servlet jsp threw exception
java.lang.VerifyError: (class: util/eMainUserLogin, method: insertDBtest signature: (Ljava/lang/String

Ljava/lang/String

Incompatible object argument for function call
at org.apache.jsp.net._1login_jsp._jspService(org.apache.jsp.net._1login_jsp:64)
blah, blah, blah...
Here is my jsp, which is very simply a login page:
<%@ page import="util.eMainUserLogin"%>
<%@ page import="java.io.*" %>
<html>
<head>
<title>New Client</title>
</head>
<%
if(request.getMethod().equalsIgnoreCase("post")){
String userId = request.getParameter("ulogin");
String pWord = request.getParameter("upword");
System.out.print(userId);
int i = 0;
eMainUserLogin emUL = new eMainUserLogin();
String imback = emUL.insertDBtest(userId);
i = 1;
System.out.print(imback);
}
%>
<body>
<table border="0">
<tr>
<td>
<form method="POST" action="">
<p></b><font color="#FF0000" size="4">*</font><font face="Arial" size="2"><b>denotes required information</b></font></p>
<table border="0" width="100%">
<tr>
<td width="30%" align="right"><font face="Arial" size="2">Login:</font></td>
<td width="20%" align="left"><input type="text" name="ulogin" size="20"><font color="#FF0000" size="4">*</font></td>
<td width="30%" align="right"><font face="Arial" size="2"></font></td>
</tr>
<tr>
<td width="30%" align="right"><font face="Arial" size="2">Email Address:</font></td>
<td width="20%" align="left"> <input type="text" name="upword" size="20"><font color="#FF0000" size="4">*</font></td>
</tr>
<tr>
<td width="30%" align="right"></td>
<td width="20%" align="left"><input type="submit" value=" Complete Registration " name="btnAddUser"></td>
<td width="30%" align="right"></td>
<td width="20%" align="left"></td>
</tr>
</table>
</form>
</tr>
</table>
</body>
</html>
NOW... here is the class that bombs (all lines indicated are also commented out when I am running this):
package util;
import java.util.ArrayList;
import java.sql.ResultSet;
import java.io.*;
import util.jdbcConnection;
public class eMainUserLogin {
public String insertDBtest(String uLogin) throws Exception{
String p = "";
System.out.println("inproc insertDB = " +uLogin);
if(uLogin==null){
p = "NULLVALUE";
}else{
if(uLogin.equals("")==true){
p = "EMPTYSTRING";
} else{
p = uLogin;
}
}
ResultSet rs = null;
jdbcConnection jc = new jdbcConnection();
// int x = 1;
String qry = "select count(clientid) as cnt from menu_client "+
"where login = lower('"+ p +"')";
// "where login = lower('
test')";
//System.out.println(qry);
// rs = jc.getResultSetfromSql(qry);
// while (rs.next()) {
// x = Integer.parseInt(rs.getObject("cnt").toString());
// p = rs.getObject("cnt").toString();
// }
p = qry;
return p;
}
}
All I want to do is verify that my query string is correct.
If I comment out: "where login = lower('"+ p +"')"; and replace it with the line below, all is well... I have used this code on a previous project with no issues at all...
I know that once I get to the DB all is well, but for my life I cannot understand the problem with this syntax, nor can some more experienced java folks I have queried (pun intended).
I am building the class using JBuilder and JDK 1.5 and then running the JSP on
tomcat 5.5.8
Does that have anything to do with it? And if so what can I do?
Any insight will be greatly appreciated...
