jdbc interface

Solutions on MaxInterview for jdbc interface by the best coders in the world

showing results for - "jdbc interface"
Mila
13 Jan 2019
1-Connection = Helps our java project
2connect to database
3
4-Statement = Helps to write and execute SQL query
5
6-ResultSet = A DataStructure where
7the data from query result stored
Darius
27 Jul 2018
1Connection = 
2  Helps our java project connect to database
3Statement = 
4  Helps to write and execute SQL query
5ResultSet = 
6  A DataStructure where the data from query result stored
7+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8    
9
10  After succesfully created the connect
11next step is STATEMENT
12
13Statement statement = connection.createStatement();
14We use createStatement() method to create
15the statement from our connection.
16-The result we get from this type of statement
17can only move from top to bottom,
18not other way around
19
20Statement statement = connection.
21createStatement(ResultSet TYPE_SCROLL_INSENSITIVE
22,ResultSet CONCUR_READ_ONLY);
23
24-The result we get from this type of
25statement can freely move between rows
26
27Once we have statement we can run
28the query and get the result to
29ResultSet format 
30		import java.sql.ResultSet;
31        
32We use the method executeQuery()
33to execute our queries
34
35ResultSet result = statement.
36              executeQuery("Select * from employees");
37