Need Help with my JSF-Project - ResultSet to List to DataTable/c:foreach

Hello!
I am struggeling heavily with JSF and JSTL and JSPs...
I want to show a list of names from a database in my JSF-Document.
I have the following bean "Category":
package de.fh_offenburg.audiodb.webapp;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.jsp.jstl.sql.Result;
public class Category {
     String name = "";
     String creationDate = "";
     int id_kategorie = 0;
     ResultSet resultset;
     Result result;
     Connection con;
     String query = "";
     List result_list;
     Category() {
          result_list = new ArrayList();
          try{
               con = new ConnectDB().connect();
               Statement statement = con.createStatement();
               query = "SELECT * FROM Category WHERE isUKat = '0'";
               resultset = statement.executeQuery(query);
               while (resultset.next()) {
                 // Get the data from the row using the column index
                 String name = resultset.getString("name");
                 // create an object for each row (yes, it is hibernate biased) ;-)
                 Cat cat = new Cat();
                 cat.setName(name);
                 cat.setId_kategorie(id_kategorie);
                 // Add the object to the list
                 result_list.add(cat);
          } catch(Exception hcat){
               System.out.println("HCat-Problem: "+hcat.getMessage());
     public java.lang.String getCreationDate() {
          return creationDate;
     public void setCreationDate(java.lang.String creationDate) {
          this.creationDate = creationDate;
     public int getId_kategorie() {
          return id_kategorie;
     public void setId_kategorie(int id_kategorie) {
          this.id_kategorie = id_kategorie;
     public java.lang.String getName() {
          return name;
     public void setName(java.lang.String name) {
          this.name = name;
     public java.sql.ResultSet getResultset() {
          return resultset;
     public void setResult_cat(java.sql.ResultSet result_cat) {
          this.resultset = result_cat;
     public void setResult(Result result) {
          this.result = result;
     public Result getResult() {
          return result;
     public List getResult_list() {
          return result_list;
     public void setResult_list(ArrayList result_list) {
          this.result_list = result_list;
     }This Bean is registered in my faces-config.xml like this:
<managed-bean>
  <managed-bean-name>category</managed-bean-name>
  <managed-bean-class>de.fh_offenburg.audiodb.webapp.Category</managed-bean-class>
  <managed-bean-scope>application</managed-bean-scope>
  <managed-property>
   <property-name>creationDate</property-name>
   <property-class>java.lang.String</property-class>
   <value/>
  </managed-property>
  <managed-property>
   <property-name>id_kategorie</property-name>
   <property-class>int</property-class>
   <value/>
  </managed-property>
  <managed-property>
   <property-name>name</property-name>
   <property-class>java.lang.String</property-class>
   <value/>
  </managed-property>
  <managed-property id="result">
   <property-name>result</property-name>
   <property-class>javax.servlet.jsp.jstl.sql.Result</property-class>
   <value/>
  </managed-property>
  <managed-property id="resultset">
   <property-name>resultset</property-name>
   <property-class>java.sql.ResultSet</property-class>
   <value/>
  </managed-property>
  <managed-property id="result_list">
   <property-name>result_list</property-name>
   <property-class>java.util.List</property-class>
   <value/>
  </managed-property>
</managed-bean>Now I try to read the list of Cats out in my JSF:
                                                  <h:dataTable value="#{category.result_list}" var="result">
                                                       <h:column>
                                                                      <h:outputText value="#{result.name}" />
                                                       </h:column>
                                                  </h:dataTable>... but that doesnt work... I got an error:
javax.servlet.ServletException: Cannot get value for expression '#{category.result_list}'
     javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
     org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
     org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
     org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
root cause So what am I doing wrong?
I did try to do the same with an JSTL-Syntax (which would be better for me, because I want to layout with DIVs not with a Table...):
                                                  <c:forEach items="#{category.result_list}" var="result">
                                                       <div class="div_mini_kat"><c:out value="#{result.name}"/></div>
                                                  </c:forEach>But that doesnt work out neigther...
Could someone please tell me what I am doing wrong? I am trying this for days now and I am feeling like a bumble-bee in a glasshouse with one small open doorway which I dont see and thousands of m^2 to crash with...
Thanks to everyone who answers in advance!!!
Fuchur

Hello!
I am struggeling heavily with JSF and JSTL and JSPs...
I want to show a list of names from a database in my JSF-Document.
I have the following bean "Category":
package de.fh_offenburg.audiodb.webapp;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.jsp.jstl.sql.Result;
public class Category {
     String name = "";
     String creationDate = "";
     int id_kategorie = 0;
     ResultSet resultset;
     Result result;
     Connection con;
     String query = "";
     List result_list;
     Category() {
          result_list = new ArrayList();
          try{
               con = new ConnectDB().connect();
               Statement statement = con.createStatement();
               query = "SELECT * FROM Category WHERE isUKat = '0'";
               resultset = statement.executeQuery(query);
               while (resultset.next()) {
                 // Get the data from the row using the column index
                 String name = resultset.getString("name");
                 // create an object for each row (yes, it is hibernate biased) ;-)
                 Cat cat = new Cat();
                 cat.setName(name);
                 cat.setId_kategorie(id_kategorie);
                 // Add the object to the list
                 result_list.add(cat);
          } catch(Exception hcat){
               System.out.println("HCat-Problem: "+hcat.getMessage());
     public java.lang.String getCreationDate() {
          return creationDate;
     public void setCreationDate(java.lang.String creationDate) {
          this.creationDate = creationDate;
     public int getId_kategorie() {
          return id_kategorie;
     public void setId_kategorie(int id_kategorie) {
          this.id_kategorie = id_kategorie;
     public java.lang.String getName() {
          return name;
     public void setName(java.lang.String name) {
          this.name = name;
     public java.sql.ResultSet getResultset() {
          return resultset;
     public void setResult_cat(java.sql.ResultSet result_cat) {
          this.resultset = result_cat;
     public void setResult(Result result) {
          this.result = result;
     public Result getResult() {
          return result;
     public List getResult_list() {
          return result_list;
     public void setResult_list(ArrayList result_list) {
          this.result_list = result_list;
     }This Bean is registered in my faces-config.xml like this:
<managed-bean>
  <managed-bean-name>category</managed-bean-name>
  <managed-bean-class>de.fh_offenburg.audiodb.webapp.Category</managed-bean-class>
  <managed-bean-scope>application</managed-bean-scope>
  <managed-property>
   <property-name>creationDate</property-name>
   <property-class>java.lang.String</property-class>
   <value/>
  </managed-property>
  <managed-property>
   <property-name>id_kategorie</property-name>
   <property-class>int</property-class>
   <value/>
  </managed-property>
  <managed-property>
   <property-name>name</property-name>
   <property-class>java.lang.String</property-class>
   <value/>
  </managed-property>
  <managed-property id="result">
   <property-name>result</property-name>
   <property-class>javax.servlet.jsp.jstl.sql.Result</property-class>
   <value/>
  </managed-property>
  <managed-property id="resultset">
   <property-name>resultset</property-name>
   <property-class>java.sql.ResultSet</property-class>
   <value/>
  </managed-property>
  <managed-property id="result_list">
   <property-name>result_list</property-name>
   <property-class>java.util.List</property-class>
   <value/>
  </managed-property>
</managed-bean>Now I try to read the list of Cats out in my JSF:
                                                  <h:dataTable value="#{category.result_list}" var="result">
                                                       <h:column>
                                                                      <h:outputText value="#{result.name}" />
                                                       </h:column>
                                                  </h:dataTable>... but that doesnt work... I got an error:
javax.servlet.ServletException: Cannot get value for expression '#{category.result_list}'
     javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
     org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
     org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
     org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
root cause So what am I doing wrong?
I did try to do the same with an JSTL-Syntax (which would be better for me, because I want to layout with DIVs not with a Table...):
                                                  <c:forEach items="#{category.result_list}" var="result">
                                                       <div class="div_mini_kat"><c:out value="#{result.name}"/></div>
                                                  </c:forEach>But that doesnt work out neigther...
Could someone please tell me what I am doing wrong? I am trying this for days now and I am feeling like a bumble-bee in a glasshouse with one small open doorway which I dont see and thousands of m^2 to crash with...
Thanks to everyone who answers in advance!!!
Fuchur

Similar Messages

  • Need help with lost iMovie project.

    I was creating an iMovie project for school and needed to save it on a USB, so I clicked on 'Export Movie' from the 'Share' options menu in iMovie. I chose the type I wanted it saved in (viewing for computers) and then a smaller screen in iMovie popped up saying it was exporting the movie, or something like that. It took about a good 30 minutes and my project was a 7 minute movie with film clips, music, transitions, ect. I exported this project to my USB but when it finished it wasn't on there and when I finally found it on the Mac somewhere, I went to drag it into my USB but it said it was full. I then dragged the project onto my desktop and tried to open it to see if it worked. When I did the iMovie icon jumped once and stopped. I clicked on iMovie and it was still there in the projects screen. I then decided to close iMovie and open the project again from my desktop to see if it would play like a normal movie but once I clicked it the iMovie icon jumped again, opened but my project that I was trying to open was not there anymore and wouldn't open from my desktop file. I cannot open it at all and view it, it has been lost from my iMovie. Is there a way that I can get it back? Really need some help with this.

    What version of iMovie are you using?
    Matt

  • I need help with my hangman project

    I'm working on a project where we are developing a text based version of the game hangman. For every project we add a new piece to the game. Well for my project i have to test for a loser and winner for the game and take away a piece of the game when the user guesses incorrectly. these are the instrcutions given by my professor:
    This semester we will develop a text based version of the Game Hangman. In each project we will add a new a piece to the game. In project 4 you will declare the 'figure', 'disp', and 'soln' arrays to be attributes of the class P4. However do not create the space for the arrays until main (declaration and creation on separate lines). If the user enters an incorrect guess, remove a piece of the figure, starting with the right leg (looking at the figure on the screen, the backslash is the right leg) and following this order: the left leg (forward slash), the right arm (the dash or minus sign), the left arm (the dash or minus sign), the body (vertical bar), and finally the head (capital O).
    Not only will you need to check for a winner, but now you will also check to see if all the parts of the figure have been removed, checking to see if the user has lost. If the user has lost, print an error message and end the program. You are required to complete the following operations using for loops:
    intializing appropriate (possible) variables, testing to see if the user has guessed the correct solution, testing to see if the user has guessed a correct letter in the solution, and determining / removing the next appropriate part of the figure. All other parts of the program will work as before.
    Declare figure, disp, and soln arrays as attributes of the class
    Creation of the arrays will remain inside of main
    Delete figure parts
    Check for loss (all parts removed)
    Implement for loops
    Init of appropriate arrays
    Test for winner
    Test if guess is part of the solution
    Removal of correct position from figure
    Output must be
    C:\jdk1.3.1\bin>java P3
    |
    |
    O
    -|-
    Enter a letter: t
    |
    |
    O
    -|-
    t _ _ t
    Enter a letter: a
    |
    |
    O
    -|-
    t _ _ t
    Enter a letter: e
    |
    |
    O
    -|-
    t e _ t
    Enter a letter: l
    |
    |
    O
    -|-
    t e _ t
    Enter a letter: s
    |
    |
    O
    -|-
    t e s t
    YOU WIN!
    C:\jdk1.3.1\bin>java P3
    Pete Dobbins
    Period 5, 7, & 8
    |
    |
    O
    -|-
    Enter a letter: a
    |
    |
    O
    -|-
    Enter a letter: b
    |
    |
    O
    -|-
    Enter a letter: c
    |
    |
    O
    -|
    Enter a letter: d
    |
    |
    O
    |
    Enter a letter: e
    |
    |
    O
    |
    _ e _ _
    Enter a letter: f
    |
    |
    O
    _ e _ _
    Enter a letter: g
    |
    |
    _ e _ _
    YOU LOSE!
    Well i have worked on this and come up with this so far and am having great dificulty as to i am struggling with this class. the beginning is just what i was suppose to comment out. We are suppose to jave for loops for anything that can be put into a for loop also.
    /* Anita Desai
    Period 5
    P4 description:
    1.Declare figure, disp, and soln arrays as attributes of the class
    2.Creation of the arrays will remain inside of main
    3.Delete figure parts
    4.Check for loss (all parts removed)
    5.Implement for loops
    A.Init of appropriate arrays
    B.Test for winner
    C.Test if guess is part of the solution
    D.Removal of correct position from figure
    //bringing the java Input / Output package
    import java.io.*;
    //declaring the program's class name
    class P4
    //declaring arrays as attributes of the class
    public static char figure[];
    public static char disp[];
    public static char soln[];
    // declaring the main method within the class P4
    public static void main(String[] args)
    //print out name and period
    System.out.println("Anita Desai");
    System.out.println("Period 5");
    //creating the arrays
    figure = new char[6];
    soln = new char[4];
    disp = new char[4];
    figure[0] = 'O';
    figure[1] = '-';
    figure[2] = '|';
    figure[3] = '-';
    figure[4] = '<';
    figure[5] = '>';
    soln[0] = 't';
    soln[1] = 'e';
    soln[2] = 's';
    soln[3] = 't';
    //for loop for disp variables
    int i;
    for(i=0;i<4;i++)
    disp='_';
    //Using a while loop to control program flow
    while(true)
    //drawing the board again!
    System.out.println("-----------");
    System.out.println(" |");
    System.out.println(" |");
    System.out.println(" " + figure[0]);
    System.out.println(" " + figure[1] + figure[2] + figure[3]);
    System.out.println(" " + figure[4] + " " + figure[5]);
    System.out.println("\n " + disp[0] + " " + disp[1] + " " + disp[2] + " " + disp[3]);
    //getting input
    System.out.print("Enter a letter: ");
    //declaring a string variable
    String data = " ";
    // call the readString method
    data = readString();
    //retrieves the character at position zero
    char temp;
    temp=data.charAt(0);
    int h;
    for(h=0;h<4;h++)
    if(temp==soln[h])
    disp[h]=soln[h];
    return;
    if(disp[h]==soln[h])
    System.out.println("You Win");
    else
    for(h=0;h<6;h++)
    if(temp!=soln[h])
    figure[h] = ' ';
    return;
    if(disp[h]!=soln[h])
    System.out.println("You Lose");
    ///Test if statements to replace user input with soln if correct
    int j;
    for(j=0;j<4;j++)
    if(temp==soln[j])
    disp[j]=soln[j];
    //declared the readString method, we specified that it would
    //be returning a string
    public static String readString()
    //make connection to the command line
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    //declaring a string variable
    String s = " ";
    //try to do something that might cause an error
    try
    //reading in a line from the user
    s = br.readLine();
    catch(IOException ex)
    //if the error occurs, we will handle it in a special way
    //give back to the place that called us
    //the string we read in
    return s;
    If anyone cann please help me i would greatly appreciate it. I have an exam coming up on wednesday also so i really need to understand this material and see where my mistakes are. If anyoone knows how to delete the parts of the hangman figure one by one each time user guessesincorrectly i would appreciate it greatly. Any other help in solving this program would be great help. thanks.

    Hi thanks for responding. Well to answer some of your questions. The professors instructions are the first 2 paragraphs of my post up until the ende of the output which is You lose!. I have to have the same output as the professor stated which is testing for a winner and loser. Yes the program under the output is what i have written so far. This is the 3rd project and in each we add a little piece to the game. I have no errors when i run the program my problem is when it runs it just prints the hangman figure, disp and then asks user ot enter a letter. Well once i enter a letter it just prints that letter to the screen and the prgram ends.
    As far as the removal of the parts. the solution is TEST. When the user enters a letter lets say Tthen the figure should display again with the disp and filled in solution with T. Then ask for a letter again till user has won and TEST has been guessed correctly. Well then we have to test for a loser. So lets the user enters a R, well then the right leg of the hangman figure should be blank indicating a D the other leg will be blank until the parts are removed and then You lose will be printed to the screen.
    For the program i am suppose to use a FOR LOOPto test for a winner, to remove the parts one at a time, and to see if the parts have been removed if the user guesses incorrectly.
    so as u can see in what i have come up with so far i have done this to test for a winner and loser:
    //declaring a string variable
    String data = " ";
    // call the readString method
    data = readString();
    //retrieves the character at position zero
    char temp;
    temp=data.charAt(0);
    int h;
    for(h=0;h<4;h++)
    if(temp==soln[h])
    disp[h]=soln[h];
    return;
    if(disp[h]==soln[h])
    System.out.println("You Win");
    else
    for(h=0;h<6;h++)
    if(temp!=soln[h])
    figure[h] = ' ';
    return;
    if(disp[h]!=soln[h])
    System.out.println("You Lose");
    Obviously i have not writtern the for loops to do what is been asked to have the proper output. the first for loop i am trying to say if the user input is equal to the soln thencontinue till all 4 disp are guessed correctly and if all the disp=soln then the scrren prints you win.
    then for the incorrect guesses i figured if the user input does not equal the soln then to leave a blank for the right leg and so on so i have a blank space for the figure as stated
    :for(h=0;h<6;h++)
    if(temp!=soln[h])
    figure[h] = ' ';
    well this doesnt work and im not getting the output i wanted and am very confused about what to do. I tried reading my book and have been trying to figure this out all night but i am unable to. I'm going to try for another hr then head to bed lol its 4am. thanks for your help. Sorry about posting in two different message boards. I wont' do it again. thanks again, anita

  • Need help with saving my project

    When I try to export and save my project, iMovie answers that I need more storage space to go on and that I need to end and restart the program. What can I do to save my project? There is lots of work in it. Thank you.

    If iMovie is only preventing you from sharing/exporting your movie, your project itself should still be OK.
    If you have everything on your internal drive it is probably getting too full (you can check with finder).   You need to free up some space or get an external hard drive.  An external drive is almost essential if you are going to do a lot of video work since file are so large.
    Geoff.

  • Need help with inserting rows in ResultSet and JTable

    hello Guru!
    i have inserted a row in my result set and i want that my table shows this row promptly after i have inserted it in my result set...
    but when i use following code for my resultset:
    rs.moveToInsertRow();
    rs.updateInt(1,nr);
    rs.updateString(2, name);
    rs.insertRow();
    Record are inserted in resultset and database but not shown in my JTable??
    Anyone a Clue to without reexecuting the query how can i display inserted row in JTable
    http://download-west.oracle.com/docs/cd/A87860_01/doc/java.817/a83724/resltse7.h
    I have refrered the following links but still clue less help Guruuuuuuu
    i m really in trobble??????

    i am just near by the Solution using the Database Metadata
    by couldn't get the ideaaaa
    ==================================================
    http://download-west.oracle.com/docs/cd/A87860_01/doc/java.817/a83724/resltse7.htm
    Seeing Database Changes Made Internally and Externally
    This section discusses the ability of a result set to see the following:
    its own changes (DELETE, UPDATE, or INSERT operations within the result set), referred to as internal changes
    changes made from elsewhere (either from your own transaction outside the result set, or from other committed transactions), referred to as external changes
    Near the end of the section is a summary table.
    Note:
    External changes are referred to as "other's changes" in the Sun Microsystems JDBC 2.0 specification.
    Seeing Internal Changes
    The ability of an updatable result set to see its own changes depends on both the result set type and the kind of change (UPDATE, DELETE, or INSERT). This is discussed at various points throughout the "Updating Result Sets" section beginning on , and is summarized as follows:
    Internal DELETE operations are visible for scrollable result sets (scroll-sensitive or scroll-insensitive), but are not visible for forward-only result sets.
    After you delete a row in a scrollable result set, the preceding row becomes the new current row, and subsequent row numbers are updated accordingly.
    Internal UPDATE operations are always visible, regardless of the result set type (forward-only, scroll-sensitive, or scroll-insensitive).
    Internal INSERT operations are never visible, regardless of the result set type (neither forward-only, scroll-sensitive, nor scroll-insensitive).
    An internal change being "visible" essentially means that a subsequent getXXX() call will see the data changed by a preceding updateXXX() call on the same data item.
    JDBC 2.0 DatabaseMetaData objects include the following methods to verify this. Each takes a result set type as input (ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_SENSITIVE, or ResultSet.TYPE_SCROLL_INSENSITIVE).
    boolean ownDeletesAreVisible(int) throws SQLException
    boolean ownUpdatesAreVisible(int) throws SQLException
    boolean ownInsertsAreVisible(int) throws SQLException
    Note:
    When you make an internal change that causes a trigger to execute, the trigger changes are effectively external changes. However, if the trigger affects data in the row you are updating, you will see those changes for any scrollable/updatable result set, because an implicit row refetch occurs after the update.
    Seeing External Changes
    Only a scroll-sensitive result set can see external changes to the underlying database, and it can only see the changes from external UPDATE operations. Changes from external DELETE or INSERT operations are never visible.
    Note:
    Any discussion of seeing changes from outside the enclosing transaction presumes the transaction itself has an isolation level setting that allows the changes to be visible.
    For implementation details of scroll-sensitive result sets, including exactly how and how soon external updates become visible, see "Oracle Implementation of Scroll-Sensitive Result Sets".
    JDBC 2.0 DatabaseMetaData objects include the following methods to verify this. Each takes a result set type as input (ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_SENSITIVE, or ResultSet.TYPE_SCROLL_INSENSITIVE).
    boolean othersDeletesAreVisible(int) throws SQLException
    boolean othersUpdatesAreVisible(int) throws SQLException
    boolean othersInsertsAreVisible(int) throws SQLException
    Note:
    Explicit use of the refreshRow() method, described in "Refetching Rows", is distinct from this discussion of visibility. For example, even though external updates are "invisible" to a scroll-insensitive result set, you can explicitly refetch rows in a scroll-insensitive/updatable result set and retrieve external changes that have been made. "Visibility" refers only to the fact that the scroll-insensitive/updatable result set would not see such changes automatically and implicitly.
    Visibility versus Detection of External Changes
    Regarding changes made to the underlying database by external sources, there are two similar but distinct concepts with respect to visibility of the changes from your local result set:
    visibility of changes
    detection of changes
    A change being "visible" means that when you look at a row in the result set, you can see new data values from changes made by external sources to the corresponding row in the database.
    A change being "detected", however, means that the result set is aware that this is a new value since the result set was first populated.
    With Oracle8i release 8.1.6 and higher, even when an Oracle result set sees new data (as with an external UPDATE in a scroll-sensitive result set), it has no awareness that this data has changed since the result set was populated. Such changes are not "detected".
    JDBC 2.0 DatabaseMetaData objects include the following methods to verify this. Each takes a result set type as input (ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_SENSITIVE, or ResultSet.TYPE_SCROLL_INSENSITIVE).
    boolean deletesAreDetected(int) throws SQLException
    boolean updatesAreDetected(int) throws SQLException
    boolean insertsAreDetected(int) throws SQLException
    It follows, then, that result set methods specified by JDBC 2.0 to detect changes--rowDeleted(), rowUpdated(), and rowInserted()--will always return false with the 8.1.6 Oracle JDBC drivers. There is no use in calling them.
    Summary of Visibility of Internal and External Changes
    Table 12-1 summarizes the discussion in the preceding sections regarding whether a result set object in the Oracle JDBC implementation can see changes made internally through the result set itself, and changes made externally to the underlying database from elsewhere in your transaction or from other committed transactions.
    Table 12-1 Visibility of Internal and External Changes for Oracle JDBC
    Result Set Type Can See Internal DELETE? Can See Internal UPDATE? Can See Internal INSERT? Can See External DELETE? Can See External UPDATE? Can See External INSERT?
    forward-only
    no
    yes
    no
    no
    no
    no
    scroll-sensitive
    yes
    yes
    no
    no
    yes
    no
    scroll-insensitive
    yes
    yes
    no
    no
    no
    no
    For implementation details of scroll-sensitive result sets, including exactly how and how soon external updates become visible, see "Oracle Implementation of Scroll-Sensitive Result Sets".
    Notes:
    Remember that explicit use of the refreshRow() method, described in "Refetching Rows", is distinct from the concept of "visibility" of external changes. This is discussed in "Seeing External Changes".
    Remember that even when external changes are "visible", as with UPDATE operations underlying a scroll-sensitive result set, they are not "detected". The result set rowDeleted(), rowUpdated(), and rowInserted() methods always return false. This is further discussed in "Visibility versus Detection of External Changes".
    Oracle Implementation of Scroll-Sensitive Result Sets
    The Oracle implementation of scroll-sensitive result sets involves the concept of a window, with a window size that is based on the fetch size. The window size affects how often rows are updated in the result set.
    Once you establish a current row by moving to a specified row (as described in "Positioning in a Scrollable Result Set"), the window consists of the N rows in the result set starting with that row, where N is the fetch size being used by the result set (see "Fetch Size"). Note that there is no current row, and therefore no window, when a result set is first created. The default position is before the first row, which is not a valid current row.
    As you move from row to row, the window remains unchanged as long as the current row stays within that window. However, once you move to a new current row outside the window, you redefine the window to be the N rows starting with the new current row.
    Whenever the window is redefined, the N rows in the database corresponding to the rows in the new window are automatically refetched through an implicit call to the refreshRow() method (described in "Refetching Rows"), thereby updating the data throughout the new window.
    So external updates are not instantaneously visible in a scroll-sensitive result set; they are only visible after the automatic refetches just described.
    For a sample application that demonstrates the functionality of a scroll-sensitive result set, see "Scroll-Sensitive Result Set--ResultSet5.java".
    Note:
    Because this kind of refetching is not a highly efficient or optimized methodology, there are significant performance concerns. Consider carefully before using scroll-sensitive result sets as currently implemented. There is also a significant tradeoff between sensitivity and performance. The most sensitive result set is one with a fetch size of 1, which would result in the new current row being refetched every time you move between rows. However, this would have a significant impact on the performance of your application.
    how can i implement this using
    JDBC 2.0 DatabaseMetaData objects include the following methods to verify this. Each takes a result set type as input (ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_SENSITIVE, or ResultSet.TYPE_SCROLL_INSENSITIVE).
    boolean deletesAreDetected(int) throws SQLException
    boolean updatesAreDetected(int) throws SQLException
    boolean insertsAreDetected(int) throws SQLException

  • Need help with a class project

    I'm new to Java and I'm having problems converting a small program to be more functional. Here is my original codeimport java.util.Arrays;
    public class Product
    // initialize arrays
       private int cdNums[] = { 0,0,0,0 };
       private String cdNames[] = { "null", "null", "null", "null" };
       private int cdUnits[] = { 0,0,0,0 };
       private double cdValue[] = { 0.0, 0.0, 0.0, 0.0 };
       private double inventoryValue[] = { 0.0, 0.0, 0.0, 0.0 };
    // initialize instance variable
       private double totalValue = 0;
       private int count;
       public Product( int invNumber[], String albumName[], int invUnits[], double invValue[] )
             cdNums = invNumber;  // store inventory number
             cdNames = albumName;  //store album name
             cdUnits = invUnits;  //store number of units
             cdValue = invValue; // store unit price
       public double calcInventoryValue()
             // calculate Inventory value
                for ( int count = 0; count < cdNums.length; count++ )
                       totalValue =0; // initialize totalValue
                       totalValue =( cdUnits[ count ] * cdValue [ count ] );
               System.out.printf( "%s%d%s%s%s%d%s%.2f%s%.2f\n", "Item #", cdNums[ count ], " is: ", cdNames[ count ], " with ", cdUnits [ count ], " units priced at $", cdValue [ count ], " gives value of $", totalValue );
             return totalValue;
          } // end calcinventoryValue method
    } // end classand the test application: import java.util.Arrays;
    public class ProductTest
       public static void main( String args[] )
            int invNumber [] = { 1,2,3,4 };
            String albumName[] = { "Wish You Were Here", "Abacab", "Animals", "Security" };
            int invUnits[] = { 200, 150, 50, 500 };
            double invValue[] = { 14.99, 9.99, 23.49, 12.99 };
         Product myProduct = new Product (invNumber, albumName, invUnits, invValue );       
            myProduct.calcInventoryValue();
         } // end main
    } // end class ProductTestWhat I want to do is convert it to read in user input instead of static lists. Here is what I have so far:
    import java.util.Arrays;
    public class Product
    // initialize arrays
       private int cdNums[];
       private String cdNames[];
       private int cdUnits[];
       private double cdValue[];
       private double inventoryValue[];
    // initialize instance variable
       private double runValue = 0;
       private double totalValue = 0;
       private int count;
       public Product( int invNumber[], String albumName[], int invUnits[], double invValue[] )
             cdNums = invNumber;  // store inventory number
             cdNames = albumName;  //store album name
             cdUnits = invUnits;  //store number of units
             cdValue = invValue; // store unit price
       public double calcInventoryValue()
             // calculate Inventory value
                totalValue = 0; // Initialize totalValue variable
                for ( int count = 0; count < cdNums.length; count++ )
                       runValue =0; // initialize runValue
                       runValue =( cdUnits[ count ] * cdValue [ count ] );
               System.out.printf( "%s%d%s%s%s%d%s%.2f%s%.2f\n", "Item #", cdNums[ count ], " is: ", cdNames[ count ], " with ", cdUnits [ count ], " units priced at $", cdValue [ count ], " gives value of $", runValue );
                     totalValue = totalValue += runValue;
              calcTotalValue( totalValue );
             return totalValue;
          } // end calcinventoryValue method
        public double calcTotalValue( double totalValue )
             System.out.printf( "%s%.2f\n", "The total value of the inventory is: $", totalValue );
              return totalValue;
           } // end calcTotalValue method
    } // end classand the new test application:
    import java.util.Arrays;
    import java.util.Scanner;
    public class ProductTest
       public static void main( String args[] )
            double totalValue = 0;
          do 
            { //  open dowhile
             int count = 0; // initialize counter
             Scanner input = new Scanner( System.in ); // call scanner to get input
             for ( int count = 0; count > 0; count++ )
               {  // open for loop
                         System.out.printf ( "%s%d%s\n", "Please enter the inventory # of Item ", count, " or 0 to quit: " );  // prompt for inventory number or sentinel value
                          int invNumber[ count ] = input.nextInt();  // get user input of Item Number
                 if ( invNumber[ count ] != 0 )  // check for sentinel
                   {  // open if
                         System.out.printf ( "%s%d\n","Please enter the album name of Item #", invNumber[ count ] );  // prompt for album name
                         String albumName[ count ] = input.nextLine();  // get input album name
                         System.out.printf ( "%s%d\n", "Please enter the number of units in stock for Item #", invNumber[ count ] );  // prompt for number of units in stock
                         int invUnits[ count ] = input.nextint();  // input rate of payment
                         System.out.printf ( "%s%.2f\n", "Please enter the unit price for Item #", invNumber[ count ] );  // prompt for unit price
                         double unitValue = input.nextDouble();  // input rate of payment
                         System.out.println();  // print blank line for readability
                   } // close if
                else
                   {  // open else
                      Product myProduct = new Product (invNumber, albumName, invUnits, invValue );       
                         myProduct.calcInventoryValue();
                   } // close else
               } // close for loop           
           } while ( invNumber != 0 );  // loop back to inputting employee name and close dowhile
        } // end main
    } // end class ProductTestthe compiler is telling me for ProductTest that it is expecting "]" for the following line: int invNumber[ count ] = input.nextInt();Do I need to store the data in a variable first and then feed it into the array? What do I need to do to complete this code?

    OK, yeah. Change the Product constructor so that it takes scalar values (as opposed to arrays) -- a single int for units in stock, and single String for name, etc.
    Then you can create multiple objects of that class, one for each CD or whatever.
    It makes sense to hardcode values in the ProductTest class, but not really in the Product class. Your ProductTest class is almost there. You know how in the main method you create a single Product object with those arrays? Change it so that you have a loop. Loop through the prices, album names, etc., and create a Product for each set of values. Then put the Product objects in an array, or better yet (and if you've covered it in class) into a Collection like a java.util.HashSet or a java.util.ArrayList.
    You said you wanted to make it take values from user input, rather than hardcoded lists. Once you've made the above change, move on to doing that. You can read user input with a java.util.Scanner. Or you can use a java.io.BufferedReader. Did the prof say to use one particular method or another?

  • Need help with an array project please =)

    I'm having trouble figuring out where to start. My project is to create an applet that accepts 20 numbers from a text field one by one and adds them to an array. The numbers have to be between 10 and 50 or else the applet shouldn't include them in the 20 but duplicates should be included in the 20. The applet then has to display all the numbers except for duplicates. example:
    user inputs:
    10,11,12,13,14,15,16,16,16,17,18,19,20,20,20,21,23,24,25,26
    applet detects that 20 numbers have been entered and displays them exluding duplicates:
    10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26
    If the user imputs a number like 72 I need to make it alert them that the number was not in the 10-50 range and not add that number to the total 20.
    I'm not asking anyone to do this for me, I'm just asking for tips on where to get a good start.
    Thanks!

    //i haven't tryed that code, and it might not work
    // anyhow, just in case, i'll also say that this is not an applet
    public class NoDublicates {
    public static void main(String[] args) {
      if (args.length < 20) {
       System.out.println("usage:\njava NoDublicates "
         + "<and 20 space separated numbers from 10 to 50 here>");
       System.exit(1);
      byte[] nums = new byte[args.length];
      int i = 0;
      for (int j = 0; j < args.length; j++) {
       try {
        int temp = Integer.parseInt(args[j]);
        if (temp <= 50 && temp >= 10) {
         nums[i++] = temp;
       } catch (NumberFormatException nfe) {
        // very bad exception, i think i'll ignore it
      if (i != 20) {
       System.out.println("it seems that i didn't get exactly 20 "
        + "parseable numbers as arguments, let's exit now.");
       System.exit(1);
      java.util.Arrays.sort(nums);
      int old = 0;
      for (int j = 0; j < 20; j++) {
       if (nums[j] != old) {
        System.out.print(nums[j] + " ");
       old = nums[j];
    }

  • Need help with inserting rows in resultset

    hello!
    i want to insert a row in my result set and i want that my table shows this row promptly after i have inserted it in my result set...
    but when i use following code for my resultset:
    rs.moveToInsertRow();
    rs.updateInt(1,nr);
    rs.updateString(2, name);
    rs.insertRow();
    and call fireTableDataChanged afterwards -> nothing happens, rows are inserted in resultset but not shown in my table??
    anyone a clue??

    rs.moveToInsertRow(); // moves cursor to the insert row
    rs.updateString(1, "AINSWORTH"); // updates the
    // first column of the insert row to be AINSWORTH
    rs.updateInt(2,35); // updates the second column to be 35
    rs.updateBoolean(3, true); // updates the third row to true
    rs.insertRow();
    rs.moveToCurrentRow();
    This is from the JAVA API. Something makes me think you might want to try doing the last method execution.
    rs.moveToCurrentRow();
    Vijay

  • Need help with calculator project for an assignment...

    Hi all, I please need help with my calculator project that I have to do for an assignment.
    Here is the project's specifications that I need to do"
    """Create a console calculator applicaion that:
    * Takes one command line argument: your name and surname. When the
    program starts, display the date and time with a welcome message for the
    user.
    * Display all the available options to the user. Your calculator must include
    the arithmetic operations as well as at least five scientific operations of the
    Math class.
    -Your program must also have the ability to round a number and
    truncate it.
    -When you multiply by 2, you should not use the '*' operator to perform the
    operation.
    -Your program must also be able to reverse the sign of a number.
    * Include sufficient error checking in your program to ensure that the user
    only enters valid input. Make use of the String; Character, and other
    wrapper classes to help you.
    * Your program must be able to do conversions between decimal, octal and
    hex numbers.
    * Make use of a menu. You should give the user the option to end the
    program when entering a certain option.
    * When the program exits, display a message for the user, stating the
    current time, and calculate and display how long the user used your
    program.
    * Make use of helper classes where possible.
    * Use the SDK to run your program."""
    When the program starts, it asks the user for his/her name and surname. I got the program to ask the user again and again for his/her name and surname
    when he/she doesn't insert anything or just press 'enter', but if the user enters a number for the name and surname part, the program continues.
    Now my question is this: How can I restrict the user to only enter 'letters' (and spaces of course) but allow NO numbers for his/her surname??
    Here is the programs code that I've written so far:
    {code}
    import java.io.*;
    import java.util.*;
    import java.text.*;
    public class Project {
         private static String nameSurname = "";     
         private static String num1 = null;
         private static String num2 = null;
         private static String choice1 = null;
         private static double answer = 0;
         private static String more;
         public double Add() {
              answer = (Double.parseDouble(num1) + Double.parseDouble(num2));
              return answer;
         public double Subtract() {
              answer = (Double.parseDouble(num1) - Double.parseDouble(num2));
              return answer;
         public double Multiply() {
              answer = (Double.parseDouble(num1) * Double.parseDouble(num2));
              return answer;
         public double Divide() {
              answer = (Double.parseDouble(num1) / Double.parseDouble(num2));
              return answer;
         public double Modulus() {
              answer = (Double.parseDouble(num1) % Double.parseDouble(num2));
              return answer;
         public double maximumValue() {
              answer = (Math.max(Double.parseDouble(num1), Double.parseDouble(num2)));
              return answer;
         public double minimumValue() {
              answer = (Math.min(Double.parseDouble(num1), Double.parseDouble(num2)));
              return answer;
         public double absoluteNumber1() {
              answer = (Math.abs(Double.parseDouble(num1)));
              return answer;
         public double absoluteNumber2() {
              answer = (Math.abs(Double.parseDouble(num2)));
              return answer;
         public double Squareroot1() {
              answer = (Math.sqrt(Double.parseDouble(num1)));
              return answer;
         public double Squareroot2() {
              answer = (Math.sqrt(Double.parseDouble(num2)));
              return answer;
         public static String octalEquivalent1() {
              int iNum1 = Integer.parseInt(num1);
    String octal1 = Integer.toOctalString(iNum1);
    return octal1;
         public static String octalEquivalent2() {
              int iNum2 = Integer.parseInt(num2);
              String octal2 = Integer.toOctalString(iNum2);
              return octal2;
         public static String hexadecimalEquivalent1() {
              int iNum1 = Integer.parseInt(num1);
              String hex1 = Integer.toHexString(iNum1);
              return hex1;
         public static String hexadecimalEquivalent2() {
              int iNum2 = Integer.parseInt(num2);
              String hex2 = Integer.toHexString(iNum2);
              return hex2;
         public double Round1() {
              answer = Math.round(Double.parseDouble(num1));
              return answer;
         public double Round2() {
              answer = Math.round(Double.parseDouble(num2));
              return answer;
              SimpleDateFormat format1 = new SimpleDateFormat("EEEE, dd MMMM yyyy");
         Date now = new Date();
         SimpleDateFormat format2 = new SimpleDateFormat("hh:mm a");
         static Date timeIn = new Date();
         public static long programRuntime() {
              Date timeInD = timeIn;
              long timeOutD = System.currentTimeMillis();
              long msec = timeOutD - timeInD.getTime();
              float timeHours = msec / 1000;
                   return (long) timeHours;
         DecimalFormat decimals = new DecimalFormat("#0.00");
         public String insertNameAndSurname() throws IOException{
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        while (nameSurname == null || nameSurname.length() == 0) {
                             for (int i = 0; i < nameSurname.length(); i++) {
                             if ((nameSurname.charAt(i) > 'a') && (nameSurname.charAt(i) < 'Z')){
                                       inputCorrect = true;
                        else{
                        inputCorrect = false;
                        break;
                        try {
                             BufferedReader inStream = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("Please enter your name and surname: ");
                             nameSurname = inStream.readLine();
                             inputCorrect = true;
                        }catch (IOException ex) {
                             System.out.println("You did not enter your name and surname, " + nameSurname + " is not a name, please enter your name and surname :");
                             inputCorrect = false;
                        System.out.println("\nA warm welcome " + nameSurname + " ,todays date is: " + format1.format(now));
                        System.out.println("and the time is now exactly " + format2.format(timeIn) + ".");
                        return nameSurname;
              public String inputNumber1() throws IOException {
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        try {
                             BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("\nPlease enter a number you want to do a calculation with and hit <ENTER>: ");
                             num1 = br.readLine();
                             double number1 = Double.parseDouble(num1);
                             System.out.println("\nThe number you have entered is: " + number1);
                             inputCorrect = true;
                        } catch (NumberFormatException nfe) {
                             System.out.println("\nYou did not enter a valid number: " + "\""+ num1 + "\" is not a number!!");
                             inputCorrect = false;
                        return num1;
         public String calculatorChoice() throws IOException {
              System.out.println("Please select an option of what you would like to do with this number from the menu below and hit <ENTER>: ");
              System.out.println("\n*********************************************");
              System.out.println("---------------------------------------------");
              System.out.println("Please select an option from the list below: ");
              System.out.println("---------------------------------------------");
              System.out.println("1 - Add");
              System.out.println("2 - Subtract");
              System.out.println("3 - Multiply");
              System.out.println("4 - Divide (remainder included)");
              System.out.println("5 - Maximum and minimum value of two numbers");
              System.out.println("6 - Squareroot");
              System.out.println("7 - Absolute value of numbers");
              System.out.println("8 - Octal and Hexadecimal equivalent of numbers");
              System.out.println("9 - Round numbers");
              System.out.println("0 - Exit program");
              System.out.println("**********************************************");
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        try {
                             BufferedReader inStream = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("Please enter your option and hit <ENTER>: ");
                             choice1 = inStream.readLine();
                             int c1 = Integer.parseInt(choice1);
                             System.out.println("\nYou have entered choice number: " + c1);
                             inputCorrect = true;
                        } catch (NumberFormatException nfe) {
                             System.out.println("You did not enter a valid choice number: " + "\""+ choice1 + "\" is not in the list!!");
                             inputCorrect = false;
                        return choice1;
         public String inputNumber2() throws IOException {
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        try {
                             BufferedReader br2 = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("\nPlease enter another number you want to do the calculation with and hit <ENTER>: ");
                             num2 = br2.readLine();
                             double n2 = Double.parseDouble(num2);
                             System.out.println("\nThe second number you have entered is: " + n2);
                             System.out.println("\nYour numbers are: " + num1 + " and " + num2);
                             inputCorrect = true;
                        } catch (NumberFormatException nfe) {
                             System.out.println("You did not enter a valid number: " + "\""+ num2 + "\" is not a number!!");
                             inputCorrect = false;
                        return num2;
         public int Calculator() {
              int choice2 = (int) Double.parseDouble(choice1);
              switch (choice2) {
                        case 1 :
                             Add();
                             System.out.print("The answer of " + num1 + " + " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 2 :
                             Subtract();
                             System.out.print("The answer of " + num1 + " - " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 3 :
                             Multiply();
                             System.out.print("The answer of " + num1 + " * " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 4 :
                             Divide();
                             System.out.print("The answer of " + num1 + " / " + num2 + " is: " + decimals.format(answer));
                             Modulus();
                             System.out.print(" and the remainder is " + decimals.format(answer));
                             break;
                        case 5 :
                             maximumValue();
                             System.out.println("The maximum number between the numbers " + num1 + " and " + num2 + " is: " + decimals.format(answer));
                             minimumValue();
                             System.out.println("The minimum number between the numbers " + num1 + " and " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 6 :
                             Squareroot1();
                             System.out.println("The squareroot of value " + num1 + " is: " + decimals.format(answer));
                             Squareroot2();
                             System.out.println("The squareroot of value " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 7 :
                             absoluteNumber1();
                             System.out.println("The absolute number of " + num1 + " is: " + decimals.format(answer));
                             absoluteNumber2();
                             System.out.println("The absolute number of " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 8 :
                             octalEquivalent1();
                             System.out.println("The octal equivalent of " + num1 + " is: " + octalEquivalent1());
                             octalEquivalent2();
                             System.out.println("The octal equivalent of " + num2 + " is: " + octalEquivalent2());
                             hexadecimalEquivalent1();
                             System.out.println("\nThe hexadecimal equivalent of " + num1 + " is: " + hexadecimalEquivalent1());
                             hexadecimalEquivalent2();
                             System.out.println("The hexadecimal equivalent of " + num2 + " is: " + hexadecimalEquivalent2());
                             break;
                        case 9 :
                             Round1();
                             System.out.println("The rounded number of " + num1 + " is: " + decimals.format(answer));
                             Round2();
                             System.out.println("The rounded number of " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 0 :
                             if (choice2 == 0) {
                                  System.exit(1);
                             break;
                   return choice2;
              public String anotherCalculation() throws IOException {
                   boolean inputCorrect = false;
                   while (inputCorrect == false) {
                             try {                              
                                  BufferedReader br3 = new BufferedReader (new InputStreamReader(System.in));
                                  System.out.print("\nWould you like to do another calculation? Y/N ");
                                  more = br3.readLine();
                                  String s1 = "y";
                                  String s2 = "Y";
                                  if (more.equals(s1) || more.equals(s2)) {
                                       inputCorrect = true;
                                       while (inputCorrect = true){
                                            inputNumber1();
                                            System.out.println("");
                                            calculatorChoice();
                                            System.out.println("");
                                            inputNumber2();
                                            System.out.println("");
                                            Calculator();
                                            System.out.println("");
                                            anotherCalculation();
                                            System.out.println("");
                                            inputCorrect = true;
                                  } else {
                                       System.out.println("\n" + nameSurname + " thank you for using this program, you have used this program for: " + decimals.format(programRuntime()) + " seconds");
                                       System.out.println("the program will now exit, Goodbye.");
                                       System.exit(0);
                             } catch (IOException ex){
                                  System.out.println("You did not enter a valid answer: " + "\""+ more + "\" is not in the list!!");
                                  inputCorrect = false;
              return more;
         public static void main(String[] args) throws IOException {
              Project p1 = new Project();
              p1.insertNameAndSurname();
              System.out.println("");
              p1.inputNumber1();
              System.out.println("");
              p1.calculatorChoice();
              System.out.println("");
              p1.inputNumber2();
              System.out.println("");
              p1.Calculator();
                   System.out.println("");
                   p1.anotherCalculation();
                   System.out.println("");
    {code}
    *Can you please run my code for yourself and have a look at how this program is constructed*
    *and give me ANY feedback on how I can better this code(program) or if I've done anything wrong from your point of view.*
    Your help will be much appreciated.
    Thanks in advance

    Smirre wrote:
    Now my question is this: How can I restrict the user to only enter 'letters' (and spaces of course) but allow NO numbers for his/her surname??You cannot restrict the user. It is a sad fact in programming that the worst bug always sits in front of the Computer.
    What you could do is checking the input string for numbers. If it contains numbers, just reprompt for the Name.
    AND you might want to ask yourself why the heck a calculator needs to know the users Name.

  • Need help with a recordset

    I need some help with a recordset that selects a series of
    vehicle makes that then show models when a make is selected. The
    problem is when I select the make it shows a list of models like it
    should, some of the make lists have five models and some have ten
    or more. What I need help with is how to limit the list to just the
    models and not include the "null" values. This makes my drop down
    list have large empty spaces at the end of the options listed. The
    query is as follows:
    SELECT *
    FROM saa.vehicle_make
    WHERE make = '#FORM.select_make#'
    Question # 2:
    What can I add to this recordset so that I can search on just
    the make alone without the model included. The submit includes both
    of the make and model lists so that makes it tough to break up.
    Here is the recordset:
    SELECT make
    FROM saa.vehicle_make
    ORDER BY make ASC
    Thanks
    Shane

    Sorry I guess I wasn't being clear. The lists work fine with
    the present recordsets but I was trying to clean them up just a
    little. I am using a table in mysql instead of an array for ease of
    maintenance due to the high number of makes and models I am working
    with.
    For question number one I was looking for sql that allows me
    to only show the models in the table for each make no matter how
    many are in the row. Currently when I use the existing recordset I
    get a long list of blank spaces as it is returning the "null"
    fields also. I would like it to just show the models and stop at
    the first null field.
    For the second question I wanted to be able to submit the
    form with just the make listed if someone wanted to see all Hondas
    lets say. Not I have to select the make also so it limits the
    return.
    Thanks for all of the input
    Shane
    Here is the code I am using for the two dependent select
    boxes:
    <p align="center">Vehicle Search by
    Make/Model</p>
    <!--- store the selected make variable after the first
    select boxes submits itself --->
    <cfif isDefined('form.select_make')>
    <cfset page.select_make = form.select_make>
    </cfif>
    <cfoutput>
    <form name="DropDown" method="post">
    <!--- query DB for the first drop down list --->
    <cfquery name="get_make" datasource="saa">
    SELECT make FROM saa.vehicle_make ORDER BY make ASC
    </cfquery>
    <!--- first drop down list --->
    <!--- NOTICE the onChange javascript event in the select
    tag, this is what submits the form after the first selection
    --->
    <p align="center">Model:<select name="select_make"
    required="yes" onchange="this.form.submit()">
    <option>Select Make</option>
    <!--- dynamically populate the first drop down list based
    on the get_make query --->
    <cfloop query="get_make">
    <option value="#make#" <cfif
    isDefined('form.select_make')><cfif form.select_make eq
    "#make#">selected</cfif></cfif>>#make#</option>
    </cfloop>
    </select></p>
    <!--- if the first selection has been made, display the
    second drop down list with the appropriate results --->
    <cfif isDefined('form.select_make')>
    <!--- query DB for second drop down list, based on the
    selected item from the first list --->
    <cfquery name="get_model" datasource="saa">
    SELECT * FROM saa.vehicle_make WHERE make =
    '#FORM.select_make#'
    </cfquery>
    <!--- second drop down list --->
    </cfif>
    </form>
    </cfoutput>
    <cfoutput>
    <form action="buyerModelSearchresults.cfm"
    method="POST">
    <p align="center">Model: <select name="model"
    required="yes">
    <option>Select Model</option>
    <!--- dynamically populate the second drop down list
    based on the get_make query --->
    <cfloop query="get_model">
    <option value="#model1#">#model1#</option>
    <option value="#model2#">#model2#</option>
    <option value="#model3#">#model3#</option>
    <option value="#model4#">#model4#</option>
    <option value="#model5#">#model5#</option>
    <option value="#model6#">#model6#</option>
    <option value="#model7#">#model7#</option>
    <option value="#model8#">#model8#</option>
    <option value="#model9#">#model9#</option>
    <option value="#model10#">#model10#</option>
    <option value="#model11#">#model11#</option>
    <option value="#model12#">#model12#</option>
    <option value="#model13#">#model13#</option>
    <option value="#model14#">#model14#</option>
    <option value="#model15#">#model15#</option>
    <option value="#model16#">#model16#</option>
    <option value="#model17#">#model17#</option>
    <option value="#model18#">#model18#</option>
    <option value="#model19#">#model19#</option>
    <option value="#model20#">#model20#</option>
    <option value="#model21#">#model21#</option>
    <option value="#model22#">#model22#</option>
    <option value="#model23#">#model23#</option>
    <option value="#model24#">#model24#</option>
    <option value="#model25#">#model25#</option>
    </cfloop>
    </select>
    </p>
    <p align="center">Search by Make/Model:</p>
    <p align="center"><input type="submit" name="Submit"
    value="Submit"></p>
    </form>
    </cfoutput>

  • Need help with codings on generating random words

    hi guys.. i need help with generating random words from a list of array. please help me with the codings.. let me know the other variables that are needed if required as well.. thanks a million..
    private String wordList[] = { "abstraction", "command", "arithmetic", "backslash" };

    Hi,
    You can use the Random class to generate Random number between 0 to the array length and use the generated random number as index in to the Strign array.
    To generate Random number use the following code
    Random r = new Random();
    num = ((r.nextInt() >>> 1) % wordList.length);
    num will have the randomly generated number.

  • Need help with almost completed plugin engine project

    Hi all,
    For a while now I have been working on a plugin engine. After a few iterations, the engine is similar to the Eclipse engine, in that plugins use extension points and extensions to allow contributions. Unlike the eclipse engine I have added the ability for plugins to fire events through the engine and other plugins can add listeners, all through the plugin.xml manifest. Dependencies are mostly handled automatically at plugin load time (when extensions get resolved to extension points, and listeners get resolved to events). For the case where a plugin needs to use classes from another plugin, dependencies are also allowed to be declared. Like the eclipse engine, activation of plugins occurs the first time a class is used within the plugin's classpath, OR a plugin can be activated after it is loaded.
    What I need help with is testing, working on examples to provide with the engine project, and feedback/suggestions before we release the M1 build. I am asking for those that are interested in this type of work to volunteer to help where applicable and possible. I want to provide a solid plugin engine to the java community, one that is easy to use, works well, and is pretty effecient in terms of resource usage and performance.
    Of particular interest to me right at the moment is dealing with multiple versions. As I see it, the engine will be used within an application and as such plugins would be distributed with a specific application version. The plugin version itself is more of a notification as to what version a plugin is, although I imagine it will help when updating at runtime as well.
    Just a few other details of the engine. It handles (or will soon) dynamic load, unload and reload of plugins at runtime. Plugins can be distributed in an archive file format, we call .par (Plugin ARchive), with additional plugin filename extensions configurable at runtime. The plugins can be developed and deployed in an expanded directory format as they are in Eclipse as well, or in the archive format. In the archive format they do not need to be unzipped when deployed, and they can contain embeded jar/zip libraries. The engine handles finding and creating classes directly out of the .par file at runtime.
    Multiple locations to find plugins are configurable before the engine starts, and even after it starts more could be added to allow additional locations to find plugins. URLs are supported, and soon the HTTP protocol will be supported so that plugins can be downloaded and installed at runtime.
    The project can be found at www.sourceforge.net/projects/genpluginengine. If you would like to get involved and help out, please sign up on the dev mail list and send an email to introduce yourself to the rest of the members on the list.
    I'll also add that I am working on a Swing UI Framework built entirely from plugins. It provides a ready-to-launce UI application that developers can simply add their plugins to, extending various extension points of the framework to have menu items, toolbar buttons, status bar access, help and preferences dialog additions, file i/o choosers, tons of open-source components ready to use (or extend to add on to), and like Eclipse, hopefully... draggable window frames that can be dropped on any other frame to form a tabbed frame of windows. Some of this is a ways off, some is getting there now. Presently you can add menu items that do allow plugin activation when first clicked, so plugins can be loaded but not activated until needed. The Preference dialog works but is not completed, and a plugin that adds a plugin control panel to view all loaded plugins, activate them, load/unload/reload, view extension points, extensions, dependencies, etc is partially completed. The point is, to allow a ready to run UI framework in Swing with an easy path for developers to quickly build applications with. If you are interested in this, when you join the mail list and introduce yourself, indicate that you are interested in this as well, as we need help with plugin development for it and would appreciate more help here too.
    Look forward to some replies.

    Might I suggest setting up a project at a known project-site? I've seen your progress and questions posted here from time to time, but one of the drawbacks is that you have to fill each post with the entirity of your vision to explain what you're doing. That's a lot of text to read - and most folks will skip right over it.
    On the other hand, a well-crafted, good-looking project web-site, with appropriate links and docs and vision statements, diagrams, etc. will have more likelyhood of attracting volunteers. java.net and sourceforge.net are likely spots to set up shop. In addition, you get CVS and bug-tracking systems, which can be quite valuable in such a large-scale project where there are lots of pieces.

  • Need Help with a Flash Web Project

    Hello, everyone. I am trying to use Flash to make a two-step
    system. I want the flash document to, first, allow a person to
    upload multiple image files and then, second, for the flash
    document be able to create a slideshow with the uploaded images and
    fade in and out from each image until the slideshow is over. I want
    it to be where the flash document creates its own slideshow with
    the images that are uploaded in the first step that I mentioned. I
    want it to do it completely on its own so I need to know how to
    give it the proper AI so that it can do this task.
    So, are there any tips that anyone has on how to do this? Can
    anyone tell me exactly how to do this? I really need help with this
    for my new website project. Thanks in advance, everyone!

    The problem with the text not appearing at all has to do with you setting the alpha of the movieclip to 0%.  Not within the movieclip, but the movieclip itself.  The same for the xray graphic, except you have that as a graphic symbol rather than a movieclip.  To have that play while inhabiting one frame you'll need to change it to a movieclip symbol.
    To get the text to play after the blinds (just a minor critique, I'd speed up the blinds), you will want to add some code in the frame where you added the stop in the blinds animation.  You will also need to assign instance names for the text movieclips in the properties panel, as well as place a stop(); in their first frames (inside).
    Let's say you name them upperText and lowerText.  Then the code you'd add at the end of the blinds animation (in the stop frame) would be...
    _parent.upperText.play();
    _parent.lowerText.play();
    The "_parent" portion of that is used to target the timeline that is containing the item making the command, basically meaning it's the guy inside the blinds telling the guy outside the blinds to do something.
    You'll probably want to add stops to the ends of the text animations as well.
    If you want to have the first text trigger the second text, then you'd take that second line above and place it in the last frame of the first text animation instead of the blinds animation.
    Note, on occasion, undeterminably, that code above doesn't work for some odd reason... the animation plays to the next frame and stops... so if you run into that, just put a play(); in the second frame to help push it along.
    PS GotoandPlay would actually be gotoAndPlay, and for the code above you could substitute play(); with gotoAndPlay(2);

  • Project Server 2013: I am using Project Server Permission Mode and need help with permission assignments?

    Hi 
    Project Server 2013: I am using Project Server Permission Mode and need help with permission assignments?
    How can I change Permissions for the individual users to see specific projects or all projects in project center and to see specific quick launch items?
    For Example: if i have 4 users, A, B, C and D. what i want is:
    User A can see everything and act as a project manager or Admin.
    User B can view all projects in project centre but can change the schedule or resource assignment etc.
    User C can only act as approver of projects and can view all projects in project centre.
    User D can only view specific projects for which permissions are given.
    can i have some expert help in sorting and understanding permission modes... as i was playing with project server mode permissions and can't figure out how to apply the above scenario to set of my user.
    Thanks in Advance
    Cheers
    AJ
    Ajay Kumar

    Hi Ajay,
    Please refer to this link for detailed explanations about PS2013 security model. 
    http://technet.microsoft.com/en-us/library/cc197638(v=office.15).aspx
    Actually, it will take a couple of days to explain in detail the security model that is a fundamental and tricky aspect of every PS implementation. But basically, you NEVER set permissions for a single user. You have groups in which your insert users. Groups
    define "what users can do". Then you associate groups to a corresponding category. Categories define "what user can see". Thus the association of a group with a category will set "what the user can do on the objects he can see". Then, for more advanced security
    level, you can use the RBS that will consist in "branches" in which you'll insert users. Based on those branches, you'll customize categories to fine-tune what user can see (for projects and resources) depending on the RBS branch and level.
    I'd advice you to start "playing" in a test environment with the default categories/groups that might probably cover your need.
    Concerning your 4 users:
    user A : add him to the "administrator" group. Be careful that you're mentionning either project manager or administrator, which are 2 groups/categories with totally different permissions level.
    user B : basically can see everything and change everything? it could be in the project manager group, assuming that there are no project visibility restrictions on the category via the RBS.
    user C : waht do you mean by "approver"? Workflow approvals? Then it will be the portfolio manager group. Task update or timesheet approval? Then it is another long topic: please refer in the documentation to the "status manager" and "timesheet manager"
    concepts. There are not related to the security model. In a few words, the status manager is the owner of the project plan, is defined for each task and approves tasks updates. The timesheet manager is an attribute defined for each resource in its parameters
    and approves resource timesheet.
    user D : you have to define which permission level must be given to this user. Basically it could be a team member that will see only projects he's in the project team. Note that team member cannot interact with the project plan in another way than submitting
    timesheets and/or tasks updates which must be approved.
    Once more, those are large and complex subjects that require a deep dive into your business model and tons of tests in a test environment.
    Hope this helps.
    Guillaume Rouyre - MBA, MCP, MCTS

  • Need help with a project

    Hi,
    I'm a final year engineering student doing my project on cloud computing. Our project is a web application developed which concerns the issue of cloud security.Our lecturers asked us to put it on the cloud instead of showing it as a web application. So we
    are trying the trial version of Windows Azure. I need help in putting my project on to the cloud. Please help regarding this as soon as possible... 
    We are using Apache tomcat, JDK 1.6, Wamp server for our web application and we have developed this using netbeans IDE
    Very Urgent!!!

    Hello there, if you're still looking for help you might not be in the right forum.  This fourm is all about Azure SQL Database.

Maybe you are looking for