Help Center > > Developer Guide> Tutorial: Development Using JDBC or ODBC> JDBC Interface Reference> java.sql.Connection

java.sql.Connection

Updated at: Jul 15, 2020 GMT+08:00

This section describes java.sql.Connection, the interface for connecting to a database.

Table 1 Support status for java.sql.Connection

Method Name

Return Type

Support JDBC 4

close()

void

Yes

commit()

void

Yes

createStatement()

Statement

Yes

getAutoCommit()

Boolean

Yes

getClientInfo()

Properties

Yes

getClientInfo(String name)

String

Yes

getTransactionIsolation()

int

Yes

isClosed()

Boolean

Yes

isReadOnly()

Boolean

Yes

prepareStatement(String sql)

PreparedStatement

Yes

rollback()

void

Yes

setAutoCommit(boolean autoCommit)

void

Yes

setClientInfo(Properties properties)

void

Yes

setClientInfo(String name,String value)

void

Yes

The AutoCommit mode is used by default within the interface. If you disable it running setAutoCommit(false), all the statements executed later will be packaged in explicit transactions, and you cannot execute statements that cannot be executed within transactions.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel