Using MySQL to interact with the database (i)

Source: Internet
Author: User
Tags object object

Public interface Daointer {
/** number of data bars displayed on a page */
Public final Integer numforonepage=5;
/**
* Query operations on the database
*
* @param sql
* A SQL statement used by PreparedStatement
* @param objects
* Array of conditions matching preparedstatement in SQL statements
* @param items
* A collection of column names to find objects in the database
* @return A list collection of map<string,string> types after padding values
*/
Public list<map<string,string>> selectentity (String sql, object[] objects, string[] items);

/**
* Add and revise the database
*
* @param sql
* A SQL statement used by PreparedStatement
* @param objects
* Array of conditions matching preparedstatement in SQL statements
* @return The number of rows affected, not successful returns-1
*/
public int changeentity (String sql, object[] objects);
}

/**
* Override to convert object type to String type
*
* @param Object
* Object type Data
* @return String type data
*/
public static String Stringtoobject (Object object) {
String s = "";
if (Object! = null) {
s = object.tostring ();
}
return s;
}

Interacting with the database using MySQL (i)

Related Article

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.