Tag: exec count () performs a span by querying the specified send NEC
DriverManager (basic service for managing a set of JDBC drivers)
It's method:
getConnection(String url, String user, String password)
.
Connection (connection to a specific database.) Executes the SQL statement in the connection context and returns the result)
It's method:
createStatement()
Statement
object to send the SQL statement to the database.
2. close()
This action occurs when the object's database and the JDBC resource are not waiting for the object to close automatically. ResultSet
prepareStatement(String sql)
Precompiled objects to send parameterized SQL statements to the database. PreparedStatement
4.setAutoCommit(boolean autoCommit)
Sets the auto-commit mode for this connection to the given State. False to not auto-commit
5.setSavepoint()
Savepoint
Object.
Statement (the object used to execute a static SQL statement and return the result it produces.) )
It's method:
1.executeQuery(String sql)
ResultSet
Object.
2. executeUpdate(String sql)
, DELETE
statements, or SQL statements (such as SQL DDL statements) that do not return any content. UPDATE
INSERT
return type int
3.close()
Statement
This action occurs when the object's database and the JDBC resource are not waiting for the object to close automatically.
PreparedStatement object that represents the precompiled SQL statement. ) (Statement sub-interface )
It's method:
1.executeQuery()
PreparedStatement
ResultSet
Object.
2.executeUpdate()
在此 PreparedStatement
对象中执行 SQL 语句,该语句必须是一个 SQL 数据操作语言(Data Manipulation Language,DML)语句,比如 INSERT
、UPDATE
或 DELETE
语句;或者是无返回内容的 SQL 语句,比如 DDL 语句。
返回值为int类型
3.setString(int parameterIndex, String x)
String
Value.
ResultSet (a data table that represents a database result set, usually generated by executing a statement that queries the database)
It's method:
1.getString(int columnIndex)
String
ResultSet
The value of the specified column in the current row of the object.
2.next()
Moves the cursor forward one row from the current position, returning a boolean type value
3.getMetaData()
ResultSet
ResultSetMetaData
ResultSet
The object that contains the type and property information for the column in the )
It's method:
1.getColumnCount()
ResultSet
The number of columns in the object. The return type is int
Important classes/interfaces in JDBC-connection, DriverManager, ResultSet, statement, and Common methods