|
עמוד:204
% > } } System . out . println ( "error in connecting" ); catch ( Exception ex ) { } statement = connection . createStatement (); connection = DriverManager . getConnection ( connectionURL , "root" , ""); Class . forName ( "com . mysql . jdbc . Driver" ) . newInstance (); -- % > אחזור מחרוזת המכילה את נתוני טבלת המשתמשים המעוצבת כטבלה < td > Address td >< td > Phone No . td >< td > Cell Phone td >< td > Email td > str += " < tr >< td > Id td >< td > User Name td >< td > First Name td >< td > Last Name td > String str = " < table style = 'border : 2 px solid blue' > " ; public String formatUsersForHtml ( ResultSet usersResultSet ) { < % ! < % -- str += " < td style = 'border : 2 px solid blue' > " + usersResultSet . getString ( "firstName" ) . toString () + " td > " ; str += " < td style = 'border : 2 px solid blue' > " + usersResultSet . getString ( "userName" ) . toString () + " td > " ; str += " < td style = 'border : 2 px solid blue' > " + usersResultSet . getString ( "id" ) . toString () + " td > " ; str += " < tr > " ; while ( usersResultSet . next ()) { try { < td > Gender td >< td > Birth Year td > tr > " ; str += " < td style = 'border : 2 px solid blue' > " ; str += " < td style = 'border : 2 px solid blue' > " + usersResultSet . getString ( "email" ) . toString () + " td > " ; str += " < td style = 'border : 2 px solid blue' > " + usersResultSet . getString ( "cellPhone" ) . toString () + " td > " ; str += " < td style = 'border : 2 px solid blue' > " + usersResultSet . getString ( "Phone" ) . toString () + " td > " ; str += " < td style = 'border : 2 px solid blue' > " + usersResultSet . getString ( "address" ) . toString () + " td > " ; str += " < td style = 'border : 2 px solid blue' > " + usersResultSet . getString ( "lastName" ) . toString () + " td > " ; } str += "Male" ; else { } str += "Female" ; if ( "F" . equals ( usersResultSet . getString ( "gender" ))) {
|
|