I need something fixed this is a Java Servlet with Wireless Multicasting

I need help I can't get this thing debugged! Its a HTTP Servlet very standard but I can't get it to work
import java.connection;
import javax.servlet.http.HttpSession;
// You need to import the java.sql package to use JDBC
import java.sql.*;
public class LoginServlet1 extends HttpServlet
private Connection con=null;
public LoginServlet1(Connection con){
this.con=con;
public Connection getConnection(){
return con.con;
public void doGet(HttpServletRequest request,HttpServletResponse response){
PrintWriter writer = response.getWriter();
HttpSession session = request.getSession(true);
String username = null;
String password = null;
String strHTML      = "";
boolean success = false;
if (((username=null) || (username.compareTo("null")==0)))
strHTML = strHTML + "<title> Lab #11 Login Error </title>";
strHTML = strHTML + "</head>";
strHTML = strHTML + "<body bgcolor=white>";
strHTML = strHTML + "Massive Error --- you need to provide a username ...please try again ...<BR><BR>";
strHTML = strHTML + "Back to the login page ..<A HREF=\"../login.html\"> click here </A>";
strHTML = strHTML + "</body>";
strHTML = strHTML + "</html>";
success = false;
else if (((password=null) || (password.compareTo("")==0)))
strHTML = strHTML + "<title> Lab #11 Login Error </title>";
strHTML = strHTML + "</head>";
strHTML = strHTML + "<script language="JavaScript">";
strHTML = strHTML + "<body bgColor=white>";
strHTML = strHTML + "Massive Error --- you need to provide a password ... please try again ...<BR><BR>";
strHTML = strHTML + "Back to the login page ...<A HREF=\"../login.html\"> click here </A>";
strHTML = strHTML + "</script>";
strHTML = strHTML + "</body>";
strHTML = strHTML + "</html>";
success = false;
else if then;
try
// Load Oracle driver
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
LoginServlet1 holder=(LoginServlet1) session.getValue("servletapp.connection");
if(holder==null){
try{
holder= new LoginServlet1(DriverManager.getConnection("jdbcoracle:thin:@macha.wit.ie:1521:MACH"));
session.putValue("servletapp.connection",holder);
catch(SQLException e){
getServletContext().log(e, "No");
catch(SQLDatabas + i)());
success= true;
catch (SQLException sql.tiny() );
strHTML = strHTML + "connection failed ....<BR>";
if (sql.tiny.getErrorCode()=Failed Connection)
strHTML = strHTML + "OOPS !!! wrong username or password...please try again ...<BR>";
else
strHTML = strHTML + "SQL Error happened ....<BR>";
strHTML = strHTML + "Error Number = " + sqlex.getErrorCode() + "<BR>";
strHTML = strHTML + "Error Message = " + sqlex.getMessage() + "<BR>";
strHTML = strHTML + "ah common cheer up, it's not the end of the world...<BR>";
strHTML = strHTML + "Back to the login page<A HREF=\"../login.html\"> click here </A>";
success = false;
if (success)
try
getServletConfig().getServletContext().getRequestDispatcher("/WEB-INF/jsp/query.jsp").forward(request,response);
catch = null(Exception ex) {
ex.printStackTrace ();
ex.printHTTP();
stmt.err();

the problem is?

Similar Messages

  • I need help fixing this... i can't get PDF to open

    [2011-08-07:20:00:49] Launching subprocess with commandline c:\Program Files (x86)\Common Files\Adobe AIR\Versions\1.0\Resources\Adobe AIR Updater -installupdatecheck
    [2011-08-07:20:00:49] Runtime Installer end with exit code 0
    [2011-08-07:20:00:49] Runtime Installer begin with version 2.7.0.19530 on Windows 7 x86
    [2011-08-07:20:00:49] Commandline is: -installupdatecheck
    [2011-08-07:20:00:49] Installed runtime (2.7.0.19530) located at c:\Program Files (x86)\Common Files\Adobe AIR
    [2011-08-07:20:00:49] Performing pingback request
    [2011-08-07:20:00:50] Pingback request completed with HTTP status 200
    [2011-08-07:20:00:50] Starting runtime background update check
    [2011-08-07:20:00:50] Begin Background update download from http://airdownload.adobe.com/air/3/background/windows/x86/patch/2.7.0.19530/update
    [2011-08-07:20:00:50] Unpackaging http://airdownload.adobe.com/air/3/background/windows/x86/patch/2.7.0.19530/update to C:\Users\Troy M\AppData\Roaming\Adobe\AIR\Updater\Background
    [2011-08-07:20:00:50] Runtime update not available
    [2011-08-07:20:00:50] Unpackaging cancelled
    [2011-08-07:20:00:50] Runtime Installer end with exit code 0
    [2011-08-07:20:01:23] Application Installer begin with version 2.7.0.19530 on Windows 7 x86
    [2011-08-07:20:01:23] Commandline is: "C:\Users\Troy M\PamperedPartnerPlus\workspace\.report\SalesReceiptReport_08082011_010122AM.pdf"
    [2011-08-07:20:01:23] Installed runtime (2.7.0.19530) located at c:\Program Files (x86)\Common Files\Adobe AIR
    [2011-08-07:20:01:24] Unpackaging file:///C:/Users/Troy%20M/PamperedPartnerPlus/workspace/.report/SalesReceiptReport_080820 11_010122AM.pdf to C:\Users\Troy M\AppData\Local\Temp\fla54C3.tmp
    [2011-08-07:20:01:24] Got an unexpected fatal error while unpackaging: [ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2 text="not an AIR file" errorID=0]
    [2011-08-07:20:01:29] Application Installer end with exit code 7
    [2011-08-07:20:01:33] Runtime Installer begin with version 2.7.0.19530 on Windows 7 x86
    [2011-08-07:20:01:33] Commandline is: -arp:uninstall
    [2011-08-07:20:01:33] Installed runtime (2.7.0.19530) located at c:\Program Files (x86)\Common Files\Adobe AIR
    [2011-08-07:20:01:37] Relaunching with elevation
    [2011-08-07:20:01:37] Launching subprocess with commandline c:\program files (x86)\common files\adobe air\versions\1.0\resources\adobe air updater.exe -eu
    [2011-08-07:20:01:37] Runtime Installer begin with version 2.7.0.19530 on Windows 7 x86
    [2011-08-07:20:01:37] Commandline is: -stdio \\.\pipe\AIR_2996_0 -eu
    [2011-08-07:20:01:37] Installed runtime (2.7.0.19530) located at c:\Program Files (x86)\Common Files\Adobe AIR
    [2011-08-07:20:01:37] Starting runtime uninstall. Uninstalling runtime version 2.7.0.19530
    [2011-08-07:20:01:37] Uninstalling product with GUID {FDB3B167-F4FA-461D-976F-286304A57B2A}
    [2011-08-07:20:01:39] Runtime Installer end with exit code 0
    [2011-08-07:20:01:39] Elevated install completed
    [2011-08-07:20:01:39] Runtime Installer end with exit code 0
    [2011-08-08:05:12:23] Runtime Installer begin with version 2.7.0.19530 on Windows 7 x86
    [2011-08-08:05:12:23] Commandline is: -silent
    [2011-08-08:05:12:23] No installed runtime detected
    [2011-08-08:05:12:23] Starting silent runtime install. Installing runtime version 2.7.0.19530
    [2011-08-08:05:12:24] Installing msi at c:\users\troym~1\appdata\local\temp\airb8a4.tmp\setup.msi with guid {FDB3B167-F4FA-461D-976F-286304A57B2A}
    [2011-08-08:05:12:43] Runtime Installer end with exit code 0
    [2011-08-08:05:14:53] Application Installer begin with version 2.7.0.19530 on Windows 7 x86
    [2011-08-08:05:14:53] Commandline is: "C:\Users\Troy M\PamperedPartnerPlus\workspace\.report\SalesReceiptReport_08082011_101451AM.pdf"
    [2011-08-08:05:14:53] Installed runtime (2.7.0.19530) located at c:\Program Files (x86)\Common Files\Adobe AIR
    [2011-08-08:05:14:54] Unpackaging file:///C:/Users/Troy%20M/PamperedPartnerPlus/workspace/.report/SalesReceiptReport_080820 11_101451AM.pdf to C:\Users\Troy M\AppData\Local\Temp\fla1120.tmp
    [2011-08-08:05:14:54] Got an unexpected fatal error while unpackaging: [ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2 text="not an AIR file" errorID=0]
    [2011-08-08:05:15:01] Application Installer end with exit code 7
    [2011-08-08:05:16:11] Application Installer begin with version 2.7.0.19530 on Windows 7 x86
    [2011-08-08:05:16:11] Commandline is: "C:\Users\Troy M\PamperedPartnerPlus\workspace\.report\ShowSummaryReport_08082011_101610AM.pdf"
    [2011-08-08:05:16:11] Installed runtime (2.7.0.19530) located at c:\Program Files (x86)\Common Files\Adobe AIR
    [2011-08-08:05:16:11] Unpackaging file:///C:/Users/Troy%20M/PamperedPartnerPlus/workspace/.report/ShowSummaryReport_0808201 1_101610AM.pdf to C:\Users\Troy M\AppData\Local\Temp\fla3F41.tmp
    [2011-08-08:05:16:11] Got an unexpected fatal error while unpackaging: [ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2 text="not an AIR file" errorID=0]
    [2011-08-08:05:16:16] Application Installer end with exit code 7
    [2011-08-08:06:29:43] Application Installer begin with version 2.7.0.19530 on Windows 7 x86
    [2011-08-08:06:29:43] Commandline is: "C:\Users\Troy M\Documents\hs_11jul.pdf"
    [2011-08-08:06:29:43] Installed runtime (2.7.0.19530) located at c:\Program Files (x86)\Common Files\Adobe AIR
    [2011-08-08:06:29:44] Unpackaging file:///C:/Users/Troy%20M/Documents/hs_11jul.pdf to C:\Users\Troy M\AppData\Local\Temp\fla13FC.tmp
    [2011-08-08:06:29:45] Got an unexpected fatal error while unpackaging: [ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2 text="not an AIR file" errorID=0]
    [2011-08-08:06:29:46] Application Installer end with exit code 7
    [2011-08-08:06:30:25] Runtime Installer begin with version 2.7.0.19530 on Windows 7 x86
    [2011-08-08:06:30:25] Commandline is:
    [2011-08-08:06:30:25] Installed runtime (2.7.0.19530) located at c:\Program Files (x86)\Common Files\Adobe AIR
    [2011-08-08:06:30:28] Launching subprocess with commandline c:\Program Files (x86)\Common Files\Adobe AIR\Versions\1.0\Resources\Adobe AIR Updater -installupdatecheck
    [2011-08-08:06:30:28] Runtime Installer end with exit code 0
    [2011-08-08:06:30:29] Runtime Installer begin with version 2.7.0.19530 on Windows 7 x86
    [2011-08-08:06:30:29] Commandline is: -installupdatecheck
    [2011-08-08:06:30:29] Installed runtime (2.7.0.19530) located at c:\Program Files (x86)\Common Files\Adobe AIR
    [2011-08-08:06:30:29] Performing pingback request
    [2011-08-08:06:30:29] Pingback request completed with HTTP status 200
    [2011-08-08:06:30:29] Starting runtime background update check
    [2011-08-08:06:30:29] Begin Background update download from http://airdownload.adobe.com/air/3/background/windows/x86/patch/2.7.0.19530/update
    [2011-08-08:06:30:29] Unpackaging http://airdownload.adobe.com/air/3/background/windows/x86/patch/2.7.0.19530/update to C:\Users\Troy M\AppData\Roaming\Adobe\AIR\Updater\Background
    [2011-08-08:06:30:30] Runtime update not available
    [2011-08-08:06:30:30] Unpackaging cancelled
    [2011-08-08:06:30:30] Runtime Installer end with exit code 0
    [2011-08-08:06:31:02] Application Installer begin with version 2.7.0.19530 on Windows 7 x86
    [2011-08-08:06:31:02] Commandline is: "C:\Users\Troy M\Documents\hs_11jul.pdf"
    [2011-08-08:06:31:02] Installed runtime (2.7.0.19530) located at c:\Program Files (x86)\Common Files\Adobe AIR
    [2011-08-08:06:31:02] Unpackaging file:///C:/Users/Troy%20M/Documents/hs_11jul.pdf to C:\Users\Troy M\AppData\Local\Temp\fla43F2.tmp
    [2011-08-08:06:31:02] Got an unexpected fatal error while unpackaging: [ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2 text="not an AIR file" errorID=0]
    [2011-08-08:06:31:05] Application Installer end with exit code 7
    [2011-08-08:06:31:08] Application Installer begin with version 2.7.0.19530 on Windows 7 x86
    [2011-08-08:06:31:08] Commandline is: "C:\Users\Troy M\Documents\hs_11jul.pdf"
    [2011-08-08:06:31:08] Installed runtime (2.7.0.19530) located at c:\Program Files (x86)\Common Files\Adobe AIR
    [2011-08-08:06:31:08] Unpackaging file:///C:/Users/Troy%20M/Documents/hs_11jul.pdf to C:\Users\Troy M\AppData\Local\Temp\fla5C13.tmp
    [2011-08-08:06:31:08] Got an unexpected fatal error while unpackaging: [ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2 text="not an AIR file" errorID=0]
    [2011-08-08:06:31:10] Application Installer end with exit code 7
    [2011-08-08:06:31:25] Runtime Installer begin with version 2.7.0.19530 on Windows 7 x86
    [2011-08-08:06:31:25] Commandline is: -arp:uninstall
    [2011-08-08:06:31:25] Installed runtime (2.7.0.19530) located at c:\Program Files (x86)\Common Files\Adobe AIR
    [2011-08-08:06:31:27] Runtime Installer end with exit code 6
    [2011-08-08:06:32:54] Application Installer begin with version 2.7.0.19530 on Windows 7 x86
    [2011-08-08:06:32:54] Commandline is: "C:\Users\Troy M\PamperedPartnerPlus\workspace\.report\ShowSummaryReport_08082011_113253AM.pdf"
    [2011-08-08:06:32:54] Installed runtime (2.7.0.19530) located at c:\Program Files (x86)\Common Files\Adobe AIR
    [2011-08-08:06:32:55] Unpackaging file:///C:/Users/Troy%20M/PamperedPartnerPlus/workspace/.report/ShowSummaryReport_0808201 1_113253AM.pdf to C:\Users\Troy M\AppData\Local\Temp\flaFB7D.tmp
    [2011-08-08:06:32:55] Got an unexpected fatal error while unpackaging: [ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2 text="not an AIR file" errorID=0]
    [2011-08-08:06:34:32] Application Installer end with exit code 7
    [2011-08-08:06:36:06] Application Installer begin with version 2.7.0.19530 on Windows 7 x86
    [2011-08-08:06:36:06] Commandline is: "C:\Users\Troy M\PamperedPartnerPlus\workspace\.report\ShowSummaryReport_08082011_113606AM.pdf"
    [2011-08-08:06:36:06] Installed runtime (2.7.0.19530) located at c:\Program Files (x86)\Common Files\Adobe AIR
    [2011-08-08:06:36:06] Unpackaging file:///C:/Users/Troy%20M/PamperedPartnerPlus/workspace/.report/ShowSummaryReport_0808201 1_113606AM.pdf to C:\Users\Troy M\AppData\Local\Temp\flaE83C.tmp
    [2011-08-08:06:36:06] Got an unexpected fatal error while unpackaging: [ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2 text="not an AIR file" errorID=0]
    [2011-08-08:06:36:08] Application Installer end with exit code 7
    [2011-08-08:06:40:11] Application Installer begin with version 2.7.0.19530 on Windows 7 x86
    [2011-08-08:06:40:11] Commandline is: "C:\Users\Troy M\PamperedPartnerPlus\workspace\.report\ShowSummaryReport_08082011_114010AM.pdf"
    [2011-08-08:06:40:11] Installed runtime (2.7.0.19530) located at c:\Program Files (x86)\Common Files\Adobe AIR
    [2011-08-08:06:40:11] Unpackaging file:///C:/Users/Troy%20M/PamperedPartnerPlus/workspace/.report/ShowSummaryReport_0808201 1_114010AM.pdf to C:\Users\Troy M\AppData\Local\Temp\flaA488.tmp
    [2011-08-08:06:40:11] Got an unexpected fatal error while unpackaging: [ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2 text="not an AIR file" errorID=0]
    [2011-08-08:06:40:17] Application Installer end with exit code 7
    [2011-08-08:06:41:40] Application Installer begin with version 2.7.0.19530 on Windows 7 x86
    [2011-08-08:06:41:40] Commandline is: "C:\Users\Troy M\PamperedPartnerPlus\workspace\.report\SalesReceiptReport_08082011_114140AM.pdf"
    [2011-08-08:06:41:40] Installed runtime (2.7.0.19530) located at c:\Program Files (x86)\Common Files\Adobe AIR
    [2011-08-08:06:41:40] Unpackaging file:///C:/Users/Troy%20M/PamperedPartnerPlus/workspace/.report/SalesReceiptReport_080820 11_114140AM.pdf to C:\Users\Troy M\AppData\Local\Temp\fla138.tmp
    [2011-08-08:06:41:41] Got an unexpected fatal error while unpackaging: [ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2 text="not an AIR file" errorID=0]
    [2011-08-08:06:42:57] Application Installer begin with version 2.7.0.19530 on Windows 7 x86
    [2011-08-08:06:42:57] Commandline is: "C:\Users\Troy M\PamperedPartnerPlus\workspace\.report\SalesReceiptReport_08082011_114257AM.pdf"
    [2011-08-08:06:42:57] Installed runtime (2.7.0.19530) located at c:\Program Files (x86)\Common Files\Adobe AIR
    [2011-08-08:06:42:57] Unpackaging file:///C:/Users/Troy%20M/PamperedPartnerPlus/workspace/.report/SalesReceiptReport_080820 11_114257AM.pdf to C:\Users\Troy M\AppData\Local\Temp\fla2E11.tmp
    [2011-08-08:06:42:58] Got an unexpected fatal error while unpackaging: [ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2 text="not an AIR file" errorID=0]
    [2011-08-08:06:43:02] Application Installer end with exit code 7
    [2011-08-08:06:44:48] Application Installer end with exit code 7

    i have reader... and this is the error message i get when i attempt to open one
    sorry, an error has occured.
    The application could not be installed because the installer file is damaged.  Try obtaining a new installer file from the application author.
    Date: Mon, 8 Aug 2011 11:19:37 -0600
    From: [email protected]
    To: [email protected]
    Subject: I need help fixing this... i can't get PDF to open
    To open files with the .pdf extension, please use http://get.adobe.com/reader/.
    Thanks,
    Chris
    >

  • My battery on my iphone theree is growning and it turns off around 80% then in order for it to turn back on i need to put it on the charger , somebody please help me i need to fix this is there anyway  ican??

    my battery on my iphone three is growning and it turns off around 80% then in order for it to turn back on i need to put it on the charger , somebody please help me i need to fix this is there anyway  ican?

    Basic troubleshooting from the User's Guide is reset, restart, restore (first from backup then as new).  Try each of these in order until the issue is resolved.
    If the issue persists, then take the device to Apple for evaluation.
    FYI, Apple will not replace the battery without first doing basic troubleshooting or testing the battery.

  • Well my ipod 4th gen was updated it shut off and now when i try to turn it on it stays on the apple logo for abit then gets stuck on a white screen od blue or mixed colores i really need help fixing this plzz help :(

    Well my ipod 4th gen was updated it shut off and now when i try to turn it on it stays on the apple logo for abit then gets stuck on a white screen od blue or mixed colores i really need help fixing this plzz help

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try on another computer
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar       

  • Ok so I am having issues with charging my iPad as well. So I took advice from this forum and yes, if you turn the brightness down my iPad charges. Thanks Apple I just went and spent money on a new charger I didn't need. Really you need to fix this issue.

    Ok so I am having issues with charging my iPad as well. So I took advice from this forum and yes, if you turn the brightness down my iPad charges. Thanks Apple I just went and spent money on a new charger I didn't need. Really you need to fix this issue.

    Wow. Okay...
    I'll let the real veterans in this forum tackle your issues one after the other. But, I can tell you, all will be well.
    My only comment would be re: your computer specs:
    BJReis wrote:
    .  This may be due to somewhat older equipment:
    GHz Intel Core Duo MacBook Pro with a 4GB memory computer with Ddr3 running OSX 10.8.4
    To be completely honest, FCPX is a RAM hog. It just is. But, RAM is relatively cheap, and the pay-off is good.
    4GB is right on the edge, IMHO. 16G is ideal.
    I wish you luck, hang in there, and standby for more help.

  • I have an iPhone 5 and if I make a call it goes blank hangs up on the people and then proceeds to facetime them automatically.  Does anyone know how to fix this?  It only started with ios7

    I have an iPhone 5 and if I make a call it goes blank hangs up on the people and then proceeds to facetime them automatically.  Does anyone know how to fix this?  It only started with ios7

    Judging by all the posts on the forum, there seems to be an issue at Apple's end, although they have made no announcement on their status page. Unfortunately, we may have to wait until Apple is more forthcoming with information.
    http://www.apple.com/support/systemstatus/

  • When syncing Apps on my iPhone 5 through iTunes, they are all greyed over and I cannot make any changes. How can I fix this. It never happened with my iPhone 4

    When syncing Apps on my iPhone 5 through iTunes, they are all greyed over and I cannot make any changes. How can I fix this. It never happened with my iPhone 4

    Connect your device to iTunes and in the the window were all the apps are greyed out make sure the 'Sync Apps' checkbox (top left corner) is selected.

  • Pls give me example of Java Servlet with Oracle

    Hi Guys,
    I am new to Database connectivity of JAVA Servlet with Oracle.
    So can you give me one complete example of connecting Java Servlet with Oracle 9i database.
    [ i mean Select statement, Insert statement..]
    I have tomcat server which comes built-in with NetBeans IDE.
    I need this because, i always come accross messages saying that " you need to change classpath this way " , or " you need to write connection this way "....
    So to avoid all this wrong things..i need your help.
    You guys can reply me on [email protected]
    Thanks & Appreciate..
    Dal Hit

    I got succeeded!
    I changed the three point:
    * add 'package hoo;' in HelloBean.java
    * add '<%@ page import="my.HelloBean" %>' in hello3.jsp
    * change '<jsp:useBean id="hello" class="HelloBean">
    to '<jsp:useBean id="hello" class="my.HelloBean">
    Before posting, I searched google three times but couldn't get answer.
    I could not get well if you didn't give me help...
    Thank you very much.

  • In outlook I do not see the clickable icons; however, I see them in internet explorer, so its something with Firefox.What do I need to fix this,I prefer Firefox

    I prefer to use Firefox and would appreciate knowing how to fix this. Thank you.

    I take it you are talking about the '''Microsoft Live Mail''' site?
    '''mail.live.com''' Outlook is a very old phased out name.
    In order to better assist you with your issue please provide us with a screenshot. If you need help to create a screenshot, please see [[How do I create a screenshot of my problem?]]
    Once you've done this, attach the saved screenshot file to your forum post by clicking the '''Browse...''' button below the ''Post your reply'' box. This will help us to visualize the problem.
    Thank you!

  • Where do I need to fix this?

    The assignment was:
    Create a non-GUI based Java application that calculates weekly pay for an employee. The application should display text that requests the user input the name of the employee, the hourly rate, and the number of hours worked for that week. The application should then print out the name of the employee and the weekly pay amount. In the printout, display the dollar symbol ($) to the left of the weekly pay amount and format the weekly pay amount to display currency. The Payroll Program application should continue to request employee information until the user enters stop as the employee name. In addition, program the application to check that the hourly rate and number of hours worked are positive numbers. If either the hourly rate or the number of hours worked is not a positive value, the application should prompt the user to enter a positive amount.
    I did the assignment but my instructor told me:
    "I’m sorry to say there were a number of problems with your program this week. To start, your program compiled and run, but it hung instantly. This was due to an incorrect semi-colon that was in place after the while statement. I had a tough time tracking that one down! Once I did, your program ran as expected...
    ...You did have one issue with your code, and this is due to the scanner object. First of all, I moved the creation of the scanner object outside of the while loop. It probably would work just fine to have it in there, but there is no need to recreate the scanner on every single iteration of the loop. This would eat up resources. I didn’t take any points off for this, just wanted to point it out so you would know in the future.
    The main problem is when you read in numbers and don’t get the end line then your program goes through to the next statement in the loop and finds that there is still an endline character out there, so you don’t get to put anything in, and it prints out the next ‘please enter …’ line.
    To fix this, add a statement
    Input.nextLine() at the end of your else statement inside of your while loop. This way it will ‘clear the buffer.’
    Here is the output I got when running your program and making fixes along the way. The line that says
    TEST
    Was something I added just to make sure I was getting to a specific place...."
    I already was graded on the project but I want to know where this fix needs to be done. Here is the code:
    // Payroll program2 created by Michelle Groves
    // Last edited April03 09
    import java.util.Scanner; // program uses Scanner
    public class PayrollProgram2
    // main method begins program execution
    public static void main( String args[] )
    System.out.println( "Welcome to the Payroll Program!" );
    boolean stop = false; // loop until user enters stop
    while (!stop);
    // create scanner to obtain input from command window
    Scanner input = new Scanner( System.in );
    System.out.println();
    System.out.println( "Please enter employee's name:" );
    String employeeName = input.nextLine(); // employee name
    if ( employeeName.equals ( "stop" ) )
    System.out.println( "End of program" ); // stop ends program
    stop = true;
    else
    double hourlyRate;
    double hoursWorked;
    System.out.println( "Please enter hourly pay:" );
    hourlyRate = input.nextDouble();
    while ( hourlyRate <= 0 ) // loop until positive number entered
    System.out.print( "Hourly rate must be a positive number. " +
    "Please enter the hourly pay: " ); // prompt for positive number
    hourlyRate = input.nextDouble();
    System.out.println( "Please enter hours worked:" );
    hoursWorked = input.nextDouble();
    while (hoursWorked <= 0) // loop until positive number entered
    System.out.print( "Hours worked must be a positive number. " +
    "Please enter hours worked: " );
    hoursWorked = input.nextDouble();
    double employeePay = hourlyRate * hoursWorked; // calculate weeks pay
    System.out.printf( "This weeks pay for %s is $%.2f",
    employeeName, employeePay );
    // Display ending message:
    System.out.println( "End of program" );
    System.out.println();
    } // end method
    } // end class

    This is my code again, just a little more readable:
    // Payroll program2 created by Michelle Groves
    // Last edited April03 09
    import java.util.Scanner; // program uses Scanner
    public class PayrollProgram2
    // main method begins program execution
    public static void main( String args[] )
    System.out.println( "Welcome to the Payroll Program!" );
    boolean stop = false; // loop until user enters stop
    while (!stop);
    // create scanner to obtain input from command window
    Scanner input = new Scanner( System.in );
    System.out.println();
    System.out.println( "Please enter employee's name:" );
    String employeeName = input.nextLine(); // employee name
    if ( employeeName.equals ( "stop" ) )
    System.out.println( "End of program" ); // stop ends program
    stop = true;
    else
    double hourlyRate;
    double hoursWorked;
    System.out.println( "Please enter hourly pay:" );
    hourlyRate = input.nextDouble();
    while ( hourlyRate <= 0 ) // loop until positive number entered
    System.out.print( "Hourly rate must be a positive number. " +
    "Please enter the hourly pay: " ); // prompt for positive number
    hourlyRate = input.nextDouble();
    System.out.println( "Please enter hours worked:" );
    hoursWorked = input.nextDouble();
    while (hoursWorked <= 0) // loop until positive number entered
    System.out.print( "Hours worked must be a positive number. " +
    "Please enter hours worked: " );
    hoursWorked = input.nextDouble();
    double employeePay = hourlyRate * hoursWorked; // calculate weeks pay
    System.out.printf( "This weeks pay for %s is $%.2f",
    employeeName, employeePay );
    // Display ending message:
    System.out.println( "End of program" );
    System.out.println();
    } // end method
    } // end class

  • I need help fixing this asap

    I'm just new to java so this code is not be the best way to do it but anyways I need to fix the repainting in this asap since its due in about 1 1/2 hrs I tried every thing I know but so far none has worked. I really don't care much about efficiency now. What's wrong with this and how do I fix this?
         public void moveDisc(int n, int s, int d, int x)
              if(s != d) {
                   if(n == 1)
                        transferDisc(s,d);
                   if (n > 1)
                        moveDisc(n-1,s,x,d);
                        transferDisc(s,d);
                        moveDisc(n-1,x,d,s);
         public void transferDisc(int s, int d) {
              cntnt[d][cntnt[d][0]+1] = cntnt[s][cntnt[s][0]];
              cntnt[s][cntnt[s][0]] = 0;
              cntnt[s][0]--;
              cntnt[d][0]++;
              peg[1].removeAll();
              peg[2].removeAll();
              peg[3].removeAll();
              for(int y = 1; y < 4; y++) {
                   peg[y].add(Box.createVerticalGlue());
                   for(int x = 7; x > 0; x--) {
                        if(cntnt[y][x] != 0)
                             peg[y].add(discs[cntnt[y][x]]);
              peg[1].repaint();
              peg[2].repaint();
              peg[3].repaint();
              movDisplay.setText(Integer.toString(++ctr));
              try {
                   Thread.sleep(1000);
              } catch(InterruptedException ie) {}
         }

    the peg[] are JPanels.
    I think it's probably in the repaint since the
    program waits for the sum total of the sleeptime and
    does nothing until the time is over then it displays
    the final position after the time is up.Very much possible. You tell the AWT thread to repaint, but right after you tell it to do nothing for a second. It's be easier if there were a correct view-model separation, you could time the changes to the model and the view would paint whatever state the model is in, without the need to wait for anything.

  • I am in password/Apple ID ****! The Apple ID that is showing up on my iPod is one I can't find the password for. I need to fix this since I reset the iPod and can't get my apps back until I can get it to accept a password. What can I do to?

    My iPod touch has an Apple ID that I haven't used for a while. It won't accept the password I had for it, and won't accept a new one either. I got a new one following the instructions, and it won't accept the new one either. I need to get this fixed and I'm getting nowhere! Please help.

    Are you running into the Activation Lock?
    iCloud: Find My iPhone Activation Lock in iOS 7
    You have to enter the Apple ID and password last used in Settings>iCloud on the iPod.
    Yo have to recover use of that ID/password
    Is there a way to find my Apple ID Name if I can't remember it?
    Yes. Visit My Apple ID and click Find your Apple ID. See Finding your Apple ID if you'd like more information.
    How do I change or recover a forgotten Apple ID Password?
    If you've forgotten your Apple ID Password or want to change it, go to My Apple ID and follow the instructions. SeeChanging your Apple ID password if you'd like more information.

  • OS X version 10.8.5; Email problem. Last Email received on my computer was on 5/27/2014. I need to fix this problem. I am receiving mail on my iPhone

    OS X version 10.8.5.
    Last Email was dated 5/27/2014. Can some one help me fix this problem?

    As a test launch iPhoto with the Option key held down and create a new, test library.  Import some photos and test to see if the same problem persists. Does it?

  • Anyone Know how to fix the Poor Connection Message for facetime for ios6. (Apple need to fix this situation)

    Anyone know how to fix this Message when using Facetime on iOS6 ?
    It been so annoying and i can not even facetime with my friend.
    My Connection is fine and everything was fine till Today after updating to iOS6 this message keeps Appearing
    Poor Connection The video will resume automatically when the connection improves.
    This has made facetime completely useless...
    im so annoyed atm from this update. the main feature on the iphone 4/4s/5 will become useless. until apple fix this problem quickly and removing that message.

    Same thing happening here. I had no problems until ios6 was installed.  I have an ipad

  • HT1947 I need to install this application on my IPOD with IOS 4.2.1 and I is not more supported!!!! help me please!!!!

    I need to install this remote application on my IPOD with IOS 4.2.1 and I is not more supported!!!! help me please!!!! I need to download an old version of remote app!!!!

    Thank you for your help are you aware of any apps that will work the iso 4.2.1 system that will let you watch movies on the phone. Also I tried to down load something else the other day and got message that Safari wont let you open this is ther any to see if i have the latest safari on my phone?

Maybe you are looking for