Results 1 to 4 of 4
  1. #1
    gpittingale is offline Member
    Join Date
    Feb 2009
    Posts
    1
    Rep Power
    0

    Question Help with query (new to java!)

    i have a form. its populated with a specific field from a mysql using java this is the code for the first page.

    <c:forEach var="parish" items="${parish.rows}">
    <option value="${parish.id}">${parish.ParishName}</option>
    </c:forEach>
    </select><br><input type="submit" value="submit" name="submit" /></form></td>

    on the second page i would like to call a the row that was selected in the dropdown box here is what i have so far:

    <sql:query var="parish" maxRows="1" 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
    <sql:param value="${param.id}"/>
    </sql:query>
    <c:set var="parish" scope="request" value="${parish.rows[0]}"/>

    i know this is not correct cause i should add something after the "FROM base_data line but i am a bit stuck to what it is can someone set me straight be abusive as you wish after it should be quite simple!!

    Thanks in advance

  2. #2
    serjant's Avatar
    serjant is offline Senior Member
    Join Date
    Jun 2008
    Location
    Ukraine,Zaporozhye
    Posts
    487
    Rep Power
    6

    Default

    Java Code:
    <sql:setDataSource dataSource="jdbc/gav" /> 
    <sql:query var="parish" maxRows="1" 
    sql="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=?"
    <sqlaram value="${param.id}"/>
    </sql:query>
    <c:set var="parish" scope="request" value="${parish.rows[0]}"/>

  3. #3
    tghn2b is offline Member
    Join Date
    Jan 2008
    Posts
    31
    Rep Power
    0

    Default

    sorry not to talk java serjant
    But if you give your photo a gamma correction of about 1.8 it will fix up the brightness, (and any other pictures that comes out of that camera) it seems that not a lot of people with electronic cameras know this.

  4. #4
    serjant's Avatar
    serjant is offline Senior Member
    Join Date
    Jun 2008
    Location
    Ukraine,Zaporozhye
    Posts
    487
    Rep Power
    6

    Default

    Quote Originally Posted by tghn2b View Post
    sorry not to talk java serjant
    But if you give your photo a gamma correction of about 1.8 it will fix up the brightness, (and any other pictures that comes out of that camera) it seems that not a lot of people with electronic cameras know this.
    Spam message?

Similar Threads

  1. Java Popup Window & Url Query String Value
    By Rivelyn in forum New To Java
    Replies: 4
    Last Post: 01-20-2011, 05:03 AM
  2. Replies: 3
    Last Post: 02-17-2009, 02:30 PM
  3. Replies: 0
    Last Post: 02-09-2009, 02:15 PM
  4. query on core java
    By venkatallu in forum New To Java
    Replies: 1
    Last Post: 09-01-2008, 02:23 PM
  5. Please Help - Java Date/Countdown Query
    By desktop_doodle in forum New To Java
    Replies: 2
    Last Post: 01-08-2008, 04:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •