Please Help with sql.Date problem

I have spent alot of time on what I thought would be an otherwise simple task, and I beleive I am close to completion but I need some much needed help. I have posted various forms of my code to try and acheive the solution but the responses received have been limited.
I am trying to delete a record from a MS Access database where a Date/Time field in the database (Err_Date) equals a date entered by the user via a textbox.
I finally have gotten the correct record to delete from the database, but what is very strange is that Tomcat is throwing a 'java.lang.NullPointerException' error. Then when I re-open the database the correct record is deleted.
Here is my code:
<%@page import="java.sql.*"%>
<%@ page import="java.text.SimpleDateFormat"%>
<%@ page import="java.util.Date"%>
<%
Connection con = null;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:errorlog", "admin", "");
catch(Exception e){
     out.println(e.getMessage());
ResultSet rs=null;
Statement stmt=null;
try {
stmt=con.createStatement();
String end = request.getParameter("To");//FROM TEXTBOX
java.text.SimpleDateFormat df = new java.text.SimpleDateFormat ("dd/MM/yyyy");
java.util.Date d2 = df.parse(end);//CONVERT STRING TO UTIL DATE
java.sql.Date date2 = new java.sql.Date(d2.getTime());//CONVERT TO SQL
PreparedStatement stmnt = con.prepareStatement("DELETE FROM tblError WHERE Err_Date = ?");
stmnt.setDate(1, date2);
stmnt.executeUpdate();
stmnt.close();          
//CLOSE RESULT SET          
rs.close();
     stmt.close();
con.close();
//CATCH EXCEPTIONS
catch (SQLException e) {
     out.println(e.getMessage());
%>

well, in case anyone ever runs into a problem this stupid again the solution is as follows.
the code to:
1. retrieve date from text box
2. covert string into util date
3. convert util date into sql date
4. delete from database
is all correct.
the problem is that I previously used String sql="SOME SQL DELETE" and then executed the result set, which of course I then had to close. This wasn't working so I switched to a Prepared Statement. I forgot to remove the 'rs.close()' statement in my code. So Tomcat was trying to close a result set that was never opened...

Similar Messages

  • Please help with an RMI problem

    Hi,
    This is probably a really simple problem which i can't spot, but i have the folloing 'HelloWorld' RMI program:
    The Client Program:
    import java.rmi.*;
    public class HelloClient {
         public static void main(String args[]) {
              if(System.getSecurityManager() == null) {
                   System.setSecurityManager(new RMISecurityManager());
              try {
                   HelloInterface obj = (HelloInterface)Naming.lookup("/HelloServer");
                   String message = obj.sayHello();
                   System.out.println(message);
                   Thread.sleep(10000);
              } catch (Exception e) {
                   System.out.println("HelloClient exception: " + e);
    }The Remote Interface:
    public interface HelloInterface extends java.rmi.Remote {
         public String sayHello() throws java.rmi.RemoteException;
    }The Server Program:
    import java.io.*;
    import java.rmi.*;
    import java.rmi.server.*;
    import java.util.Date;
    public class HelloServer extends UnicastRemoteObject implements HelloInterface {
         public HelloServer() throws RemoteException {
              super();
         public String sayHello() throws RemoteException {
              return "Hello World, the current system time is " + new Date();
    }And finally the class which binds the object to the registery:
    import java.rmi.*;
    public class RegisterIt {
         public static void main(String args[]) {
              try {
                   HelloServer obj = new HelloServer();
                   System.out.println("Object instantiated: " + obj);
                   Naming.rebind("/HelloServer", obj);
                   System.out.println("HelloServer bound to registery");
              } catch (Exception e) {
                   System.out.println(e);
    }Now, this program works fine on my computer at home(XP!!!!!) but when i try to run it on the computers in college which run NT, it comes up with the following exceptions when i try to run RegisterIt:
    Java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    Java.lang.ClassNotFoundException: HelloServer_StubThis is saying that it cannot find the stub which is generated, but i use the folloing .bat file to load up the program:
    echo Creating remote object skelton classes....
    rmic -d . HelloServer
    start rmiregistry -J-Djava.security.policy=test.policy
    start java RegisterIt
    start java -Djava.security.policy=test.policy HelloClientThe stub is definitely created(it worked at home and i have checked in the directory and there are clearly the files HelloServer_Stub.class and HelloServer_Skel.class). The PATH is set correctly otherwise the registery would not be able to run correctly etc and therefore i am completely stuck as to why it doesn't work.
    Please help as it is very important for me.
    Many Thanks
    Cath

    I did not have any problem with Windows 2000 at all but only with Windows XP (and to think XP is a 2000 hybrid!).
    I have the same error: a ClassNotFoundException on the stub file.
    Any help will be appreciated. Thanks.

  • Urgent Please help with a Conferencing problem in CUCM 6.1

    /* Style Definitions */
    table.MsoNormalTable
    {mso-style-name:"Table Normal";
    mso-tstyle-rowband-size:0;
    mso-tstyle-colband-size:0;
    mso-style-noshow:yes;
    mso-style-priority:99;
    mso-style-qformat:yes;
    mso-style-parent:"";
    mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
    mso-para-margin:0cm;
    mso-para-margin-bottom:.0001pt;
    mso-pagination:widow-orphan;
    font-size:11.0pt;
    font-family:"Calibri","sans-serif";
    mso-ascii-font-family:Calibri;
    mso-ascii-theme-font:minor-latin;
    mso-fareast-font-family:"Times New Roman";
    mso-fareast-theme-font:minor-fareast;
    mso-hansi-font-family:Calibri;
    mso-hansi-theme-font:minor-latin;
    mso-bidi-font-family:"Times New Roman";
    mso-bidi-theme-font:minor-bidi;}
    We have a configuration of CUCM 6.1. We have 24 voice ports (FXO) configured in H 323 registered with the call manger.  A CUE 3.2 configured for IVR and mail box. Gateway is a Cisco 3845 and the IOS version is 12.4(15) T10
    The problem is whenever a conference is configured with an outside number the FXO port is not releasing after the call disconnects.  It is not FXO disconnect problem. This happens only when a conference is taking place. There is no problem with any other outside or inside calls.
    I am attaching the configuration of Gateway. Please help me with the problem, I am very much thankful for you that.

    The Family pack covers upto 5 computers, other Install Disc cover one computer only.

  • Help with SQL Date

    Hi
    How can I convert a string in 'YYYYMMDD' format to SQL date (in the format 'YYYYMMDD' and also 'YYYYMMDD HH24:MI:SS) to use in my SQL-query (for Oracle Database)
    Thanks for your help
    Praveen Padala

    Hi
    How can I convert a string in 'YYYYMMDD' format to
    SQL date (in the format 'YYYYMMDD' and also 'YYYYMMDD
    HH24:MI:SS) to use in my SQL-query (for Oracle
    Database)
    Thanks for your help
    Praveen PadalaI've done quite a few dates from Java to an Oracle DB. I like to use the SimpleDateFormat class in the java.text packadge.
    import java.text.*; //Use this import
    //In your class
    SimpleDateFormat myDateFormatter = new SimpleDateFormat("dd-MMM-yyyy", new Locale("en","US"));
    //The .format method returns a string. With this format string it can be included in an SQL command
    myDateFormatter.format(myDate);
    You can also use a SimpleDateFormat object with the format of your other dates to get a Date object that can be given to the SimpleDateFormat object set up to format in Oracle compatable form.
    myDate is an object of type Date.
    Hope this helps!
    Kevin.

  • Please-Help with SQL NewBee

    Hello please help me with an sql, I have a table with 2 fields, I want to check if one of the field is blank, mining that it dosn't contain anything.
    if table called Test has 2 fields name ,age.
    how do I check in sql if age is blank.
    thanks

    Are you trying to do this through mSQL in Lite?
    - Junius

  • Please help with Nokia N95 problem.

    If anyone can help with this I’d be much appreciated, I have a N95 on contract with T-Mobile. When I try to play videos from myspace, or you tube etc… I get a message telling me the following.
    “Hello, Either you either have JavaScript turned off or an old version of macromedia's flash player click here to get the latest flash player”.
    I then get the option of clicking on a link within the previous sentence statement that directs me to acrobat downloads home page where I get the following message.
    “We are unable to locate a web player that matches your platform and browser. Please visit our table of recommended web players”
    This is deeply frustrating as in nearly every other way I feel the phone is perfect. If Any one can hep me fix this problem I’d be much appreciated.

    daperk,
    You should post this to board "Smartphones, Nseries and Eseries Devices".

  • Please help with column float problem in IE8

    Hi there,
    Sorry to be so pushy - but I am desperate for help!!
    Having serious problems with my site in some PC's showing Internet Explorer 8. My right column floated right is moving down the page underneath the left column..
    It shows fine on IE8 on my PC - however on my clients PC (vista with IE8) it is showing up as mentioned above. Is there a fix for this.
    Here is my link http://www.dooks.com/pgs/welcome.html
    The css is all there! If you need anything please let me know as I need to get this sorted - I have had serious issues with this site that I have never had before with other sites and am starting to think there is a bug in my software. I redid the index page and this one page (linked above) to see what my problems are - so help with query v appreciated.
    Many thanks,
    Karen

    Lawrence_Cramer wrote:
    A point to keep in mind is that IE8 is still in Beta.
    Not anymore.
    http://www.microsoft.com/Presspass/press/2009/mar09/03-18IE8AvailablePR.mspx
    "REDMOND, Wash. — March 18, 2009 — Today Microsoft Corp. announced the availability of Windows Internet Explorer 8, the new Web browser that offers..."
    Mark A. Boyd
    Keep-On-Learnin' :-)

  • Please Help with text parsing problem

    Hello,
    I have the following text in a file (cut and pasted from VI)
    12 15 03 12 15 03 81 5 80053 1 1,2,3 $23.00 1 ^M
    12 15 03 12 15 03 81 5 84550 1 1,2,3 $15.00 1 ^M
    12 15 03 12 15 03 81 5 84100 1 1,2,3 $15.00 1 ^M
    12 15 03 12 15 03 81 5 83615 1 1,2,3 $15.00 1 ^M
    12 15 03 12 15 03 81 5 82977 1 1,2,3 $15.00 1 ^M
    12 15 03 12 15 03 81 5 80061 1 1,2,3 $44.00 1 ^M
    12 15 03 12 15 03 81 5 83721 1 1,2,3 $15.00 1 ^M
    12 15 03 12 15 03 81 5 84439 1 1,2,3 $44.00 1 ^M
    12 15 03 12 15 03 81 5 84443 1 1,2,3 $40.00 1 ^M
    12 15 03 12 15 03 81 5 85025 1 1,2,3 $26.00 1 ^M
    12 15 03 12 15 03 81 5 85008 1 1,2,3 $5.00 1 ^M
    this method reads the text from a file and stores it in a ArrayList
        public ArrayList readInData(){
            File claimFile = new File(fullClaimPath);
            ArrayList returnDataAL = new ArrayList();
            if(!claimFile.exists()){
                System.out.println("Error: claim data - File Not Found");
                System.exit(1);
            try{
                BufferedReader br = new BufferedReader(new FileReader(claimFile));
                String s;
                while ((s = br.readLine()) != null){
                         System.out.println(s + " HHHH");
                        returnDataAL.add(s);
            }catch(Exception e){ System.out.println(e);}
            return returnDataAL;
        }//close loadFile()if i print the lines from above ... from the arraylist ... here is waht i get ...
    2 15 03 12 15 03 81 5 80053 1 1,2,3 $23.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 84550 1 1,2,3 $15.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 84100 1 1,2,3 $15.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 83615 1 1,2,3 $15.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 82977 1 1,2,3 $15.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 80061 1 1,2,3 $44.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 83721 1 1,2,3 $15.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 84439 1 1,2,3 $44.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 84443 1 1,2,3 $40.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 85025 1 1,2,3 $26.00 1 HHHH
    HHHH
    12 15 03 12 15 03 81 5 85008 1 1,2,3 $5.00 1 HHHH
    HHHH
    I see the ^M on the end of the lines ... but i dont understand why im getting the blank lines
    in between each entry ... I printed "HHHH" just to help with debugging ... anyone have any ideas why i am getting the extra blank lines?
    thanks,
    jd

    maybe its a FileReader deal.. Im not sure, maybe try using InputStreams. This code works for me (it reads from data.txt), give it a try and see if it works:
    import java.io.*;
    public class Example {
         public Example() throws IOException {
              BufferedReader b = new BufferedReader(new InputStreamReader(new FileInputStream("data.txt")));
              String s = "";
              while ((s = b.readLine()) != null) {
                   System.out.println(s);
              b.close();
         public static void main(String[] args) {
              try {
                   new Example();
              catch (IOException e) {
                   e.printStackTrace();
    }

  • Please help with SQL command

    Hi,
    I'm trying to update a record but I don't know how to update one field in this record. This is my code so far
    private void updateProcess() {
    int nrows;
    String sql = "UPDATE student SET s_first = '" + txtS_first.getText()
         + "', s_mi = '" + txtS_mi.getText()
         + "', s_last = '"      + txtS_last.getText()
         + "', s_dob = TO_DATE('" + txtS_dob.getText() + "', 'MM/DD/YYYY')"
    /* In a database table, after the s_dob column is f_id column, but a user will see info of this field by f_first and f_last instead of f_id. How can I update this column with f_id if a user's input is f_first and f_last? What if f_first and f_name that a user enters doesn't exist in the database, is there anyway to display an error for this case?
         + "', f_first = '" + txtF_first.getText()
         + "', f_last = '" + txtF_last.getText()
         + "' WHERE s_id = " + txtS_id.getText();
    try {
         nrows = stmt.executeUpdate(sql);
    // I think this part I'm doing wrong because the text area doesn't display these strings
         if(nrows > 0) {
         lblShowResult.setText("Update successed");
         lblShowResult.setVisible(true);
    } // end if
    else {
         lblShowResult.setText("Update failed");
    lblShowResult.setVisible(true);
    } // end else
         rset.close();
    } // end try
    catch (SQLException e) {}
    catch (NullPointerException e){}
    } // end updateProcess

    If you read the docs for executeUpdate, you'll see that it returns the number of rows affected. So if it returns zero, then no rows matched.
    Also, you should be using PreparedStatement rather than Statement. Then you won't have to worry about weird characters in strings or formatting dates (you can just give it a java.sql.Date object).

  • Please help with SQL amount calulation

    -- Results
    with t as ( 
    select 'P11877' Mstr_Program,   1 Year_of_study, 'BUSI1490' program_module,  20 no_of_stud,    1 rank,   30 program_credits,  30 cumm_credits   from dual union all
    select 'P11877',                1,              'COMP1365',                 20,               2,        30,                  60               from dual union all
    select 'P11877',                1,              'BUSI1375',                 20,               3,        30,                  90               from dual union all
    select 'P11877',                1,              'COMP1363',                 20,               4,        30,                  120              from dual union all
    select 'P11877',                2,              'MARK1174',                 8,                1,        30,                  30               from dual union all
    select 'P11877',                2,              'FINA1068',                 8,                2,        15,                  45               from dual union all
    select 'P11877',                2,              'INDU1062',                 8,                3,        30,                  75               from dual union all
    select 'P11877',                2,              'BUSI1329',                 8,                4,        15,                  90               from dual union all
    select 'P11877',                2,              'MARK1138',                 8,                5,        30,                  120              from dual)
    select * from t;-- Each MSTR_PROGRAM can have 1 or many program_module
    -- MSTR_PROGRAM's can run for 1 or 2 years (case above is two years) so some modules run in year 1 and some in year 2
    -- NO_OF_STUD is the number of students on the module
    -- RANK basically ranks the modules by the number of students on them grouped by program and year
    -- e.g.row_number() OVER (PARTITION BY Mstr_Program, Year_of_study) ORDER BY COUNT(STUDENT_ID) DESC) rank
    -- PROGRAM_CREDITS: each module has a fixed number of credits
    -- CUMM_CREDITS: Increments the credit count of modules
    -- SUM(program_credits * 10) OVER (PARTITION BY Mstr_Program, Year_of_study
    -- ORDER BY count(STUDENT_ID) desc ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) cumm_credits
    -- I want to trim of any modules once the CUM_CREDITS hits 120. As seen above. I achieve this by wrapping the main query is another SELECT then LIMIT
    -- that WHERE cum_credit <=120.
    -- But what I need is:
    -- In some cases the the cumm_credit maybe on lets say 90credits then the next module is worth 40 credits. This next module will not show as it
    -- will be greater than 120 credits, so i need to pro-rata it:
    -- So if credit_count > 120, then the last module is counted pro-rata as follows: 1- ((credit count - 120) / credits from last module
    -- Can anyone help with how I can incorporate this into my current code: The SELECT portion of the Original SQL is below: I simplified column names
    -- e.t.c in the above so they wont be the same
    SELECT * FROM (
         SELECT
               ,SR_PROGRAM Mstr_Program
               ,DECODE (SORLCUR_YEAR, 1, 1,
                                      2, 2,
                                      3, 3,
                                      4, 3, SR_YEAR) year_of_study
               ,SCT_SUBJ_CODE||SCT_CRSE_NUMB program_module
               ,COUNT(student_ID)                    no_of_stud
               ,row_number() OVER (PARTITION BY sr_program,
                                            DECODE (sr_year, 1, 1,
                                                                  2, 2,
                                                                  3, 3,
                                                                  4, 3, SR_YEAR) ORDER BY COUNT(student_id) DESC, scbcrse_title asc) rank
               ,(SCT_CREDIT_HRS * 10) program_credits
               ,SUM(SCT_CREDIT_HRS * 10) OVER (PARTITION BY sr_program, DECODE (sorlcur_year, 1, 1,
                                                                                                       2, 2,
                                                                                                       3, 3,
                                                                                                       4, 3, SR_YEAR)
                                                    ORDER BY count(student_id) desc ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) cumm_credits
    WHERE cumm_credit <=120
    ORDER BY Mstr_Program, YEAR_OF_STUDY, RANK asc;

    Maybe
    SELECT Mstr_Program,year_of_study,program_module,no_of_stud,rank,program_credits old_program_credits,cumm_credits old_cumm_credits,
           case when cumm_credits > 120
                then program_credits - cumm_credits + 120
                else program_credits
           end new_program_credits,
           case when cumm_credits > 120
                then 120
                else cumm_credits
           end new_cumm_credits
      FROM (SELECT SR_PROGRAM Mstr_Program,
                   DECODE(SORLCUR_YEAR,1,1,2,2,3,3,4,3,SR_YEAR) year_of_study,
                   SCT_SUBJ_CODE||SCT_CRSE_NUMB program_module,
                   COUNT(student_ID) no_of_stud,
                   row_number() OVER (PARTITION BY sr_program,DECODE(sr_year,1,1,2,2,3,3,4,3,SR_YEAR)
                                          ORDER BY COUNT(student_id) DESC,scbcrse_title) rank,
                   10 * SCT_CREDIT_HRS program_credits,
                   10 * SUM(SCT_CREDIT_HRS) OVER (PARTITION BY sr_program,DECODE(sorlcur_year,1,1,2,2,3,3,4,3,SR_YEAR)
                                                      ORDER BY count(student_id) desc
                                                  ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) cumm_credits
    WHERE 0 <= case when cumm_credits > 120
                     then program_credits - cumm_credits + 120
                     else program_credits
                end
    ORDER BY Mstr_Program,YEAR_OF_STUDY,RANKRegards
    Etbin
    Edited by: Etbin on 16.12.2011 8:50
    with
    t as   /* simulating the result achieved */
    (select 'P11877' Mstr_Program,1 Year_of_study, 'BUSI1490' program_module,20 no_of_stud,1 rank,30 program_credits,30 cumm_credits from dual union all
    select 'P11877',             1,               'COMP1365',               20,           2,     40,                70              from dual union all
    select 'P11877',             1,               'BUSI1375',               20,           3,     30,                100             from dual union all
    select 'P11877',             1,               'COMP1363',               20,           4,     40,                140             from dual union all
    select 'P11877',             2,               'MARK1174',               8,            1,     30,                30              from dual union all
    select 'P11877',             2,               'FINA1068',               8,            2,     50,                80              from dual union all
    select 'P11877',             2,               'INDU1062',               8,            3,     30,                110             from dual union all
    select 'P11877',             2,               'BUSI1329',               8,            4,     50,                160             from dual union all
    select 'P11877',             2,               'MARK1138',               8,            5,     30,                190             from dual
    select Mstr_Program,Year_of_study,program_module,no_of_stud,rank,program_credits old_credits,cumm_credits old_cumm,
           case when cumm_credits > 120
                then program_credits - cumm_credits + 120
                else program_credits
           end new_program_credits,
           case when cumm_credits > 120
                then 120
                else cumm_credits
           end new_cumm_credits
      from t
    where 0 <= case when cumm_credits > 120
                     then program_credits - cumm_credits + 120
                     else program_credits
                end

  • Please help with card deck problem

    the class is supposed to create a shuffled deck of 52 cards
    it first is supposed to make an ordered deck of cards and then pull cards out of it and into another deck at random. when a card has been pulled, it is supposed to be taken out of the ordered deck. I say supposed to because for some reason a test of the class gives a strange runtime error:
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1 >= 1
    at java.util.Vector.elementAt(Vector.java:427)
    at Deck.<init>(Deck.java:17)
    at testDeck.main(testDeck.java:5)
    the following is the code:
    import java.util.*;
    public class Deck
      private Vector orderedDeck = new Vector(52);
      private Vector deck = new Vector(52);
      public Deck()
        //creates an ordered deck where rank and suit are the rank and suit of a Card variable
        for(int rank=0; rank<=12; rank++)
          for(int suit=0; rank<=3; rank++)
            this.orderedDeck.addElement(new Card(rank,suit));
        //supposed to shuffle the ordered deck into a final deck
        for(int i=0; i<53; i++)
          int randomNum = (int) (Math.random()*(this.orderedDeck.size()+1));
          this.deck.addElement(orderedDeck.elementAt(randomNum));
          this.orderedDeck.removeElementAt(randomNum);
    }please help me figure out my problem

         for(int i=0; i<53; i++)This should be:
         for(int i=0; i<52; i++)because you declared your array of size 52.
    -Eric

  • Please help with another card problem

    this one is a strange one(if you saw the other one you might understand this better) in any case, i am getting a error and i do not see the reason
    here is the code
      public Card getCard(int i)
        switch(i)
          case 1: return (Card) card1;
          case 2: return (Card) card2;
          case 3: return (Card) card3;
          case 4: return (Card) card4;
          case 5: return (Card) card5;
      }the compiler says that there is no return statement. i don not see the problem as there are five of them and all seem to be accessable.
    please tell me if i am not seeing something or have it all wrong.
    btw card1,card2,etc. are Card variables so that is not the problem. this method is supposed to return one of five cards according to the int that is passed to it.
    please help me!

    public Card getCard(int i)
    switch(i)
    case 1: return (Card) card1;
    case 2: return (Card) card2;
    case 3: return (Card) card3;
    case 4: return (Card) card4;
    case 5: return (Card) card5;
    }No, no, no. It's really very simple. Imagine this:
    Card c = getCard(42);
    c.someMethod();What is the value of 'c' after calling getCard()? And what happens when c.someMethod() is called?
    You see, the getCard() method does not have a return statement in all cases. A method that returns a value either must be absolutely guaranteed to execute a return statement in all cases, unless an exception in thrown.
    So the simplest thing you can do (or an array of cards might be in order here) is just add a default: case that throws an exception.
       public Card getCard(int i)
         switch(i)
           case 1: return (Card) card1;
           case 2: return (Card) card2;
           case 3: return (Card) card3;
           case 4: return (Card) card4;
           case 5: return (Card) card5;
           default: throw new IllegalArgumentException("Invalid card number " + i);
    Or, if you expect that in normal operation you'll be passing in values other than 1-5, instead of throwing an exception you could return null. But it sounds to me like in your case, it is a bug if a value other that 1-5 is ever passed in.

  • Please help with my post problems

    What and how you can recover the lost e-mail in Outlook Express??? 
      Missing mail for 3 months, one day took the incoming mail on the laptop, letters have been about 2500, the next day I come to work I open mail on your computer-no mail on the laptop also lost mail. Please help to recovery pst?

    Recovery ToolBox for Outlook to PST is a specialized tool for fast and efficient recovery of user data from corrupted Outlook PST files.
    http://www.outlook.recoverytoolbox.com/

  • Please Help with background color problem in loaded .swf

    I am stuck!
    This is Flash CS4...
    I created a flash application which loads in many other little flash applications (.swf files) based on menu selections.
    When I change one of the little applications the changes are viewable except when I change the background color.
    After the first time I view the application, the background color changes do not carry over to the main app.  I run the little ones stand alone and they show the new color, then I run the main app and any other changes I have made are there but not the color change.  When I remove the file and the load fails, the old backround color still displays in the container movie clip the .swf was previously loaded into.
    I have tried several different options and the only thing that worked was renaming and copying and deleting and making a big mess.  There has to be a way to force a refresh of this mysteriously saved color. doesn't there?
    Please help!
    Thanks!
    Vivian

    Hi Antonia
    I am loading the swf into an instance of a movie clip:
    var myLoader:MovieClipLoader = new MovieClipLoader();
    myLoader.loadClip("Capitalization.swf",  contCapitalization);
    it is the background of Capitalization.swf that will not change
    this is AS 2 since the app was created before I upgraded
    Any ideas?

  • Please help with the versioncue problem.

    I know this is not the right place to post this but please, I need fast help. When I open a project in Photoshop CS3 it says "Cannot find the missing module blablabla versioncue.dll". I've searched around a little and found someone who said that 2 updates would fix it. I downloaded the updates but when I started to install it said "Can't find the product to update".
    For some extra info, I just reformated comp and I've considered it might be something about missing files or something and if so, can someone add [email protected] and send to me because this is important. This is also because I have a schoolproject where Photoshop will be needed.
    I'm also suspicious if I actually have the documents and settings files for CS3 since I only copied the whole files from programs when I reformated it.
    Please help!

    >since I only copied the whole files from programs when I reformated it.
    you need to do a full install from the original discs david. simply copying the files won't do it.

Maybe you are looking for