Query data for Java JDBC Connection database and queries for direct use of SQL

Source: Internet
Author: User

Tag:java   jdbc    database    

JDBC package connection is a good premise: systemauthorizingrealm c = new Systemauthorizingrealm (); conn = C.getconnection ();//conn = ((DataSource) Springcontextutil.getbean ("DataSource"). getconnection ()            ;            PreparedStatement PS = conn.preparestatement (SQL);            Ps.setstring (I1, Token.getusername (). Trim ());            Ps.setstring (I2, Encrypt.getmd5 (string.valueof (Token.getpassword ())). Trim ());            System.out.println (Encrypt.getmd5 (string.valueof (Token.getpassword ()));  //when executed here, I can query the data when I put SQL and related parameters into the tool;  ResU Ltset rs = Ps.executequery (); //This is actually printed false, supposedly the data should be true, right?            System.out.println (Rs.next ());    does that help guide you? 

Query data for Java JDBC Connection database and queries for direct use of SQL

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.