A summary of the programming problems of a trickle-flow---

Source: Internet
Author: User

It is not too early, although I am not sleepy, but there is tomorrow's life, must continue.
Just finish this and go to sleep. Dragged on for days.

March 9, 2015 01:27:28
Problem 1:jdbc->dao, at first want to write a generic can query a set of functions, SELECT count(*) FROM users This method is implemented, and I want to implement a like this with a group SELECT count(*) FROM users GROUP BY address by this general method, I created a new entity class number, found that the compilation pass, Consult others, finally solve.
Workaround: The number class names in ① and Java conflict. ② I went astray, like this sentence, is very specific, the change is much more natural, I do not need to implement a common method

The problem 2:jdbc connected when Class.forName (Driverclass), Drivermanager.getconnection (), although I know that in the re-driver has already registered the driver, But how do you convert a class instance to a new Driver ()?
java.sql.DriverManager.registerDriver(new Driver());
Solution: Class.forName (Driverclass), obtained is actually loaded the driver class instance, it realizes the transformation itself.

Question 3:sql statement, in the execution of such a query, why will the error?

SELECT rownum, *FROM employees;

Why do I have to add a table name to the front?
Resolved: Not Resolved

A summary of the programming problems of a trickle-flow---

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.