Hi everybody,
i am new to java and trying to develop a bit of an app i have created the first page, dynamicall filled a dropdown box all is fine i press the submit button and i get the error below:

java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0)

i persume that i am not getting the data from the form correctly and i am having an issue with it can some body please tell me where i am going wrong?
here is the java code for the form on the first page:

<form action="response.jsp">
                        Select a Parish: <select name="id">
                            <c:forEach var="parish" items="${parish.rows}">
                                <option value="${parish.id}">${parish.ParishName}</option>
                          </select><input type="submit" value="submit" name="submit" /></form>

here is the java code for my response page:

<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
<sql:query var="parish" scope="application" dataSource="jdbc/gav">
SELECT ParishName, OwnerOccupierHousehold, OwnerOccupierPercOfOverall,
OwnerOccupierCo2Emissions, SocialRentedHousehold, SocialRentedPercOfOverall,
SocialRentedCo2Emissions, PrivateRentedHousehold, PrivateRentedPercOfOverall,
PrivateRentedCo2Emission, TotalHouseholds, TotalPerc, Average, Total2001,
TotalEstimatedTotal2006, EmissionsPerPerson, EmissionPerHousehold, EmissionsPerParish,
EnergyChampionsNeeded, NumberOfPeopleAtWork, NumberOfSchoolAgeChildren  FROM base_data
Where id LIKE <sql:param value="${param.id}"/>
<c:set var="parish" scope="application" value="${parish.rows[0]}"/>

i call the data like this:


the taglibs are on both pages
got a feeling this could be something really simple that i am missing
thanks in advance.

8 Years
Discussion Span
Last Post by gpittingale

dude you are a star!! thankyou just a quick question though : do you know where i can get a good tutorial on maths and java?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.