Archive for November, 2007

Friday, November 9th, 2007

ResultSet myResultSet = null; public StatementBean() {super();} public String getPassword( String accountID ) throws Exception { String passwordOnDB = null ; String query = passwordQuery + accountID ; Statement stmt = myConn.createStatement(); myResultSet = stmt.executeQuery( query ); if ( myResultSet != null ) { myResultSet.next() ; passwordOnDB = myResultSet.getString( “password” ) ; myConn.takeDown() ; } return passwordOnDB ; } public boolean getAccountInfoQuery( String accountID ) throws Exception { String query = accountInfoQuery + accountID ; Statement stmt = myConn.createStatement(); myResultSet = stmt.executeQuery( query ); return (myResultSet != null); } public boolean get() throws Exception { return myResultSet.next(); } public String getColumn( String inCol) throws Exception { return myResultSet.getString(inCol); } } The StatementBean class contains code to perform the actual database connect through a superclass called SQLBean. The code for SQLBean is shown in Listing 10-6. Listing 10-6: Code for SQLBean.java package chapter10 ; import java.sql.*; import java.io.*; public class SQLBean{ private String myDriver = “sun.jdbc.odbc.JdbcOdbcDriver”; private String myURL = “jdbc:odbc:stock”; protected Connection myConn; public SQLBean() {} public void makeConnection() throws Exception { Class.forName( myDriver); myConn = DriverManager.getConnection(myURL); }
Our Colorado hosting facilities are located in Little Rock, Colorado. Colorado web hosting datacenter which we have is linked on five major US backbones which gives you assurance that your site will be online 24/7 a day. More details you can find out in Web Hosting Colorado part.

Thursday, November 8th, 2007

Thursday, November 8th, 2007

Tuesday, November 6th, 2007

Monday, November 5th, 2007

Sunday, November 4th, 2007

CustomerBean customer = new CustomerBean( acctNumber ) ; String password = customer.getPassword() ; boolean redirectToLogin = false ; if ( password.length() == 0 ) { session.setAttribute(”message”, “Account Number ” + acctNumber + ” Not on File. Enter Another Account Number”) ; redirectToLogin = true ; } else if ( !password.equals(enteredPassword) ) { session.setAttribute(”message”, “Password Entered Does Not Match Password For Account ” + acctNumber ) ; redirectToLogin = true ; } if ( redirectToLogin ) { %> The first statement worthy of note in checkLogin.jsp is the page directive, shown here: The page directive serves several uses in checkLogin.jsp, as explained in the following sections. Using the JSP Page Directive Note the use of a JSP error page, errorpageex1.jsp, in the preceding code example. Any errors in JSP page processing cause the JSP engine to invoke errorpageex1.jsp. For more information on error page errorpageex1.jsp, see the sidebar “Explaining errorpageex1.jsp.” Explaining errorpageex1.jsp The code in Listing 10-3 indicates errorpageex1.jsp as the page which should be used if any errors occur while processing the login page. Let’s look at how this error page works. An Error Has Occurred!!!

Saturday, November 3rd, 2007

Friday, November 2nd, 2007

Thursday, November 1st, 2007