Начать. Это бесплатно
или регистрация c помощью Вашего email-адреса
JBDC создатель Mind Map: JBDC

1. SQL Statements


1.1.1. Creates a new row


1.2.1. Removes existing data


1.3.1. Change existing data


1.4.1. Reads data

2. Four keys Interfaces JAVA API

2.1. Driver

2.1.1. DriverManager Factory method getConnection() JAR file contains java.sql.Driver file Older JAR files

2.2. Connection

2.2.1. Conncect database JDBC URL Three parts

2.3. ResultSet

2.3.1. Create a ResultSet with three diferent types TYPE_FORWARD_ONLY Go through the data in order Default TYPE_SCROLL_INSENSITIVE Go through the data in any order TYPE_SCROLL_SENSITIVE Go through the data in any order

2.3.2. Creates a ResultSet with concurrency modes CONCUR_READ_ONLY Reads data but not write it CONCUR_UPDATABLE Read and write data

2.3.3. Method next() Returns true if existing data moves a cursor position data

2.3.4. get methods Wrappers index int or name column index begins 1

2.4. Statement

2.4.1. executeUpdate() returns rows affected

2.4.2. executeQuery() returns ResultSet Only SELECT SQL Statement

2.4.3. execute() returns boolean true if the first result is a ResultSet object getResultSet() false if it is an update count or there are no results getUpdateCount()

3. Database specific

3.1. JAR file implements interfaces

4. Close resources

4.1. avoid leaking resources

4.1.1. Closing a Connection automatically closes the Statement and ResultSet objects

4.1.2. Closing Statement automatically closes the ResultSet

4.2. try-with-resources

4.2.1. Does not require explicit closing

5. Dealing Exceptions

5.1. SQLException

5.1.1. getMesage returns a human-readable message as to what went wrong

5.1.2. getErrorCode Retrieves the vendor-specific exception code for this SQLException object

5.1.3. getSQLState returns a code as to what went wrong