NOTES
NOTES
NOTES
An inner join is a join of two or more tables that returns only those rows
(compared using a comparison operator) that satisfy the join condition.
Syntax:EQUI JOIN
SELECT column_list
FROM table1, table2....
WHERE table1.column_name =
table2.column_name;
or
SELECT *
FROM table1
JOIN table2
[ON (join_condition)]
INNER JOIN
SQL Code:
SELECT foods.item_name,foods.item_unit,
company.company_name,company.company_city
FROM foods
INNER JOIN company
ON foods.company_id =company.company_id;
SELECT *
FROM company
NATURAL JOIN foods;
SELECT *
FROM table1
LEFT [ OUTER ] JOIN table2
ON table1.column_name=table2.column_name;
import java.sql.*;
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
OR
Class.forName("oracle.jdbc.driver.OracleDriver");
while (iterator.hasNext())
System.out.print(iterator.next() + " ");
while (iterator.hasNext())
System.out.print(iterator.next() + " ");
Statement: Used for general purpose access to the database and executes a static
SQL query at runtime.
PreparedStatement: Used to provide input parameters to the query during execution.
CallableStatement: Used to access the database stored procedures and helps in
accepting runtime parameters