Compounding Calculator 6.0

Source: Internet
Author: User

The interface has been upgraded to add the user registration in the login screen, more perfect function to be continued ....

Main code:

1  PackageDataBase;2 3 Importjava.sql.Connection;4 ImportJava.sql.ResultSet;5 Importjava.sql.SQLException;6 Importjava.sql.Statement;7 8  Public classSingupconnect {9     PrivateConnection Connection;Ten     PrivateStatement Statement; One ResultSet ResultSet; A     PrivateString name; -     PrivateString password; -      PublicString GetName () { the         returnname; -     } -      Public voidsetName (String name) { -          This. Name =name; +     } -      PublicString GetPassword () { +         returnpassword; A     } at      Public voidSetPassword (String password) { -          This. Password =password; -     } -      PublicSingupconnect () { -connection=Connectionfactory.getinstane (). MakeConnection (); -     } in      Public voidsin_in () { -ResultSet resultset=NULL; toString sql= "SELECT * from User"; +         Try { -Statement=connection.createstatement (); the}Catch(SQLException e) { *              $ e.printstacktrace ();Panax Notoginseng         } -         Try { theresultset=statement.executequery (SQL); +              while(Resultset.next ()) { AName=resultset.getstring ("name"); thePassword=resultset.getstring ("Password"); +             } -}Catch(SQLException e) { $              $ e.printstacktrace (); -         } -         Try { the              while(Resultset.next ()) { -System.out.println (resultset.getstring ("username"));WuyiSystem.out.println (resultset.getstring ("Password")); the             } -}Catch(SQLException e) { Wu              - e.printstacktrace (); About         } $         finally{ -             Try { - resultset.close (); -}Catch(Exception E2) { A                  +             } the             Try { - statement.close (); $}Catch(Exception E2) { the                  the             } the             Try { the connection.close (); -}Catch(Exception E2) { in              the             } the         } About          the     } the      Public voidsinup (String name,string password) { the         Try { +Connection.setautocommit (false); -Userdao userdao=NewUserdaoimpl (); theUser user=NewUser ();Bayi user.setname (name); the User.setpassword (password); the Userdao.save (connection, user); - connection.commit (); -}Catch(Exception e) { the             Try { the Connection.rollback (); the}Catch(Exception E2) { the e2.printstacktrace (); -             } the         } the     } the}

Compounding Calculator 6.0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.