0% found this document useful (0 votes)
5 views

JDBC by Durga Review Synopsis

The document outlines various JDBC driver types including Type 1 (ODBC), Type 2 (OCI), Type 3 (middleware), and Type 4 (thin driver), along with their configurations and usage examples. It explains how to execute SQL statements using JDBC, handle result sets, and the implications of different driver types on SQL execution. Additionally, it provides SQL query examples for data retrieval and manipulation within a database.

Uploaded by

krrish31d
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

JDBC by Durga Review Synopsis

The document outlines various JDBC driver types including Type 1 (ODBC), Type 2 (OCI), Type 3 (middleware), and Type 4 (thin driver), along with their configurations and usage examples. It explains how to execute SQL statements using JDBC, handle result sets, and the implications of different driver types on SQL execution. Additionally, it provides SQL query examples for data retrieval and manipulation within a database.

Uploaded by

krrish31d
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

jdbc api - java.sql, javax.

sql
type1 - odbc driver
type2 - OCI
type3 - middleware
type4 - thindriver
regestringDriver - jdbc4, java 1.6
type1Driver - need DSN service - till XP - till java8
type 2 Driver - jdbc:oracle:oci8:XE, ojdbc14,6,7 - oracle 10g,11g,12c
type4 driver - jdbc:oracle:thin//localhost:1521:XE
type 3 driver - middleware - IDS - 3 tier - jdbc:id//localhost:12/conn?
dsn=sysdnstype3
- ids.sql.IDSDriver, jdk13drv.jar
XE - databaseSID - select * from global-name, tnsnames.ora file
type -5 - progress data direct - com.ddtech.jdbc.oracle.OracleDriver,
jdbc:datadirect:oracle//localhost:1521:XE
why no need to load and register driver from jdbc4
st.executeQuery - ResultSet - rs.next() - returns boolean, rs.getXXX(),
rs.getXXX(1), rs.getXXX(coloumnName)
st.executeUpdate - int row count, 0 - drop, truncate, ddl
st.execute - both select, non - select, true for select, false for non-select
if(st.execute) { st.getResultSet } , if(!st.execute) { st.getUpdateRowCount}
st.close, will close rs aswell,
st.executeQuery(updateQuery) , type1 driver SQLException, type4 - EmptyResultSet,
SQLException while accessing resultSet
st.executeUpdate(selectQuery), type1 driver SQLException, type4 driver no. of rows
selected.
by default commit is true
order of colums in resultset is of the order specified in the query
if selected only two colums and tried to print rs.getString(3) - 3rd coloum will
get SQLException
select count(*) from employees;
select max(esal) from employees;
select * from employees where esal in (select min(esal) from employees);
select * from (select eno,ename,sid,dob,rank() over (order by esal DESC) ranking
from employees)where ranking="+n";
select * from employees order by desc
select * from employees oder by asc
select * from employees where esal like 'd%'

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy