Learn something about JDBC (some of the mistakes that occur during the learning process)

Source: Internet
Author: User

A mistake that comes up when you do a little exercise, pay first.



For
' WHERE idcard= ' 123412199507082314 ' at line 1

It's been looking for a long while, no problem, wrong code.

PrivateStudent Searchstudent (intsearchtype) { String sql = "Select Flowid,type,idcard,examcard,studentname" + ", location, grade" + " from E Xamstudent "+" WHERE "; Scanner Scanner=NewScanner (system.in);//1. Determine how the query is based on the input searchtype//2. Determine the SQL statement according to SearchType        if(searchtype==1) {System.out.print ("Please enter your ID number:"); String Idcard=Scanner.next (); SQL =sql+ "idcard=" "+idcard+" "; }Else{System.out.print ("Please enter the ticket number:"); String Examcard=Scanner.next (); SQL =sql+ "examcard=" "+examcard+" "; }

This red part of the problem has not been found
The final discovery is actually the first red part of the grade and from the from between no space caused by ....

Learn something about JDBC (some of the mistakes that occur during the learning process)

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.