Dbconnectionpool is described in detail as follows:
I. Construction of Dbconnectionpool
constructor to obtain all of the above parameters:
Public Dbconnectionpool (string name, string URL, String user,
String password, int maxconn) {
THIS.name = name;
This. url = URL;
This.user = user;
This.password = password;
This.maxconn = Maxconn;
}
Save all parameters in the instance variable.
Second, open a connection from the pool
Dbconnectionpool provides two ways to chec
specifications mentioned above.
// Context (Environment) role, which uses hashmap to store the value corresponding to the variableClass Context{Private map valuemap = new hashmap ();Public void addvalue (variable X, int y){Integer YI = new INTEGER (y );Valuemap. Put (x, Yi );}Public int lookupvalue (variable X){Int I = (integer) valuemap. Get (x). intvalue ();Return I;}}// Abstract expression role, which can also be implemented using interfacesAbstract class expression{Public abstract
Detailed descriptions of four functions of mysql_result mysql_fetch_row mysql_fetch_array mysql_fetch_object in php
Mysql tutorial _ result (): The advantage lies in ease of use; its disadvantage is that there are few functions. One call can only obtain one row of elements in the result dataset, which is less efficient for large-scale database tutorials;
The value of a field in the returned result set returned by the mysql_result () function.
If successful, the function returns the field value.
database.Using system. Data. oledb;
/// /// This is mainly the database connection class used in the message book. because there are not many data operations, the conventional operation classes are also put here./// Public class ODB{Public string name;Public String email;Public String QQ;Public String MSN;Public String URL;Public String title;Public String concent;Public String face;Public String IP;Public String PWD;Public String uid;Public String pwda;Public datetime DTT;Public ODB (){//// T
is mainly the database connection class used in the message book. because there are not many data operations, the conventional operation classes are also put here./// Public class odb{Public string name;Public string email;Public string qq;Public string msn;Public string url;Public string title;Public string concent;Public string face;Public string ip;Public string pwd;Public string uid;Public string pwda;Public DateTime dtt;Public odb (){//// TODO: add the constructor logic here//}Public stati
ADO. NET provides connection to connect to the database and command object to query the database. Like the connection object, there are two types of commands: oledbcommand and sqlcommand. The difference is the same as that of the connection object.
To manipulate the database, you must first use connection to connect to the database, and then create a command to query. There are several creation methods, for example:
Sqlcommand cmd;
String strcon = "Server = localhost; database = northwind; trust
The details are as follows:To allow PHP to execute the preceding statement, we must use the mysql_query () function. This function is used to send queries or commands to MySQL connections.ExampleIn the following example, we created a database named "my_db: The code is as follows:Copy code $ Con = mysql_connect ("localhost", "peter", "abc123 ");If (! $ Con){Die ('co
functions of each role are implemented according to the specification mentioned above.
Context (Environment) role, using HASHMAP to store the value of the variable's corresponding class context {private Map ValueMap = new HashMap ();
public void AddValue (Variable x, int y) {integer yi = new Integer (y);
Valuemap.put (x, Yi);
public int LookupValue (Variable x) {int i = ((Integer) valuemap.get (x)). Intvalue ();
return i;
}//Abstract expression role, y
Dbconnectionpool
constructor to obtain all of the above parameters:
Public Dbconnectionpool (string name, string URL, String user,String password, int maxconn) {THIS.name = name;This. url = URL;This.user = user;This.password = password;This.maxconn = Maxconn;}Save all parameters in the instance variable.
Four, open a connection from the pool
Dbconnectionpool provides two ways to check for connections. Both methods return an available connection and create a new connection if there is no ex
and R2 of the interpreter is the Terminator expression.(3) Non-terminator expressions (nonterminal expression) role: Each rule in the grammar requires a specific non-terminator expression, the non-terminator expression is generally the syntax of the operator or other keywords, such as the formula R=R1+R2, "+" is not Terminator, The interpreter that parses "+" is a non-terminator expression.(4) environment (context) role: The task of this role is generally used to store the grammar of the indivi
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.