共用方式為


executeQuery Method (java.lang.String)

Runs the given SQL statement and returns a single SQLServerResultSet object.

public final java.sql.ResultSet executeQuery(java.lang.String sql)

參數

sql

A String that contains an SQL statement.

傳回值

A SQLServerResultSet object.

例外狀況

SQLServerException

備註

This executeQuery method is specified by the executeQuery method in the java.sql.Statement interface.

This method overrides the executeQuery method that is found in the SQLServerStatement class.

Calling this method will result in an exception since the SQL statement for the SQLServerPreparedStatement object is specified when the object is created.

另請參閱

參考

SQLServerPreparedStatement Class

概念

executeQuery Method (SQLServerPreparedStatement)
SQLServerPreparedStatement Methods
SQLServerPreparedStatement Members