File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes JSP error: invalid arguments in call . PLEASE HELP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP error: invalid arguments in call . PLEASE HELP " Watch "JSP error: invalid arguments in call . PLEASE HELP " New topic

JSP error: invalid arguments in call . PLEASE HELP

G Gopal

Joined: Sep 24, 2003
Posts: 4
I am running tomcat 5.0 on W2K. I am new to java, jsp and tomcat. I have created a JSP page which will retrieve records from an oracle table. I am getting an error meesage stating: invalid arguments in call . Can some one please help me. Here is the code:
Oracle JDBC Bean & Tomcat JSP
<h1>Employee Table</h1>
<table border="1" width="400">
<td><b>Load Status</b></td>
<td><b>Migragte Flag</b></td>
<td><b>Load ID</b></td>
<td><b>History Start</b></td>
<td><b>History End</b></td>

<%@ page import="java.sql.*" %>
<%@ page import="*" %>
// Identify a carriage return character for each output line
try {
// The HTTP request's parameters to get a database connection
String servernm = "DWHSE";
String database = "P002";
String username = "DM_DATA";
String password = "DM_DATA";
// We access the database directly from the JSP with the Oracle JDBC driver
DriverManager.registerDriver (new oracle.jdbc.OracleDriver());
// Define connection string and make a connection to database
Connection conn = DriverManager.getConnection("jdbc racle:thin:@DWHSE:1521 002, DM_DATA, DM_DATA");
Statement stat = conn.createStatement();
// Create a recordset
ResultSet rset = stat.executeQuery("Select * From load_status");
// Expecting at least one record
if( ! ) {
throw new IllegalArgumentException("No data found for the Cars table");
while( {
String empno = rset.getString("FILE_NAME");
String ename = rset.getString("LOAD_FLG");
String job = rset.getString("FACILITY_NBR");
String mgr = rset.getString("LOAD_STATUS_TIMESTAMP");
String hiredate = rset.getString("MIGRATE_HISTORY_FLG");
String sal = rset.getString("LOAD_ID");
String comm = rset.getString("HISTORY_LOAD_START_TIMESTAMP");
String deptno = rset.getString("HISTORY_LOAD_END_TIMESTAMP");
<td><%= empno %></td>
<td><%= ename %></td>
<td><%= job %></td>
<td><%= mgr %></td>
<td><%= hiredate %></td>
<td><%= sal %></td>
<td><%= comm %></td>
<td><%= deptno %></td>
catch( Exception er ) {
<exception><%= er.getMessage()%></exception>


William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
I think you are trying to do too much in JSP - try creating a Java "helper" class to conduct the actual query. Typically this is done as a "JavaBean".
You can test and debug that class outside the JSP environment. Then, when you are sure it is working you can use it inside a JSP.
Sainudheen Mydeen
Ranch Hand

Joined: Aug 18, 2003
Posts: 218
Connection conn = DriverManager.getConnection("jdbc racle:thin:@DWHSE:1521 002, DM_DATA, DM_DATA");

You are using the method getConnection(String url, String username, String password) which takes three arguments.
You have misplaced the double quote.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63865

Listen to William for he is wise. The best practice is to factor as much processing as possible out of the JSP pages. The Java that remains in your JSP should be there in order to format the display.
For each snippet of Java in your page, ask yourself "is this Java here to help render the view?". If the answer is no, it doesn't belong on the page and should be moved elsewhere.
Long term, the best thing you can do for yourself is to study the Model 2 architectural pattern. You will someday thank yourself for doing so.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: JSP error: invalid arguments in call . PLEASE HELP
It's not a secret anymore!