Java Tutorial - 8 | Edureka

preview_player
Показать описание
Take instructor-led Live class on Java Tutorial at :

The following topics were covered in this Java Tutorial:

Sql Basics, Databas, JDBC Connection, Insert query, Update query, Delete Query and Sql functions.

Database:
Database is a collection of data in an organized way so that we can update, modify data present in database easily. You can update it, modify it, insert rows, delete rows in your database and you can manage your database easily. Data stored in database is permanent until you delete the database. Oracle, MySQL, MS-Access, DB2, Sybase are the different databases available.

Why do we need database? - Database is used to store and whenever required it will retrieve data from database and use it in your application.

How to store data in database?
Data will be stored in "Tables" in database in the form of "Records". One by one you will add rows to the table. Each row is called a record. Table is a collection of relational data in 2D i.e in the form of rows and columns. i.e first we create a database and then create a table in that, later store data in the table.
SQL ( Structure Query Language):
SQL is a language used to access and modify the data stored in database. It uses statements to access the database. All the things like insert data into database, retrieving data from database, updating and deleting can be done using SQL statements. SQL Statements can be divided into two types: DDL, DML
DDL (Data Definition language):
DDL statements are used for creation or deletion of database. The commands present in DDL are: Create, Alter, Drop.

DML (Data Manipulation Language):
These statements are used for managing the data in database. The commands present in DDL are: Insert -- to insert the values in the table of database. We use "insert" keyword for this.
Update-to update the record or column in the table by specifying the condition so that the database knows where to update. We use "update" keyword for this.
Delete - to delete the record(one or many) in the table by specifying the condition so that the database knows which record to be deleted. We use "delete" keyword for this
Select -- to retrieve the records from the table. You can retrieve either all the columns or specific columns of the table. You can apply conditions while retrieving records. We use "select" keyword for this

How to write a program in jdbc?
Register the Driver i.e connecting to DSN that you have actually created.
Connecting to database i.e we use an object of connection interface and establish connection
Create SQL statement in java i.e create statements and prepared statement
Execute SQL statements i.e writing queries for inserting , deleting, updating, retrieving
Retrieve Result i.e store the retrieved values from ResultSet.
Close Connection i.e close the connection after the task is completed.

Рекомендации по теме
Комментарии
Автор

i have been following your tutorial from 1-8, it has been very helpful to me, i would like to say very big thank you for the resource.

kennethchibuikeochiabuto
Автор

suppperb ...i learnt a lott from it..without any cost and my oops funda have cleared ..thanks a

faiyazmeghreji
Автор

hello vineet sir i would like to join your class for android...and advance java..!

faiyazmeghreji
Автор

I created "system DSN" and after that i see that path is missing. Also no suitable driver found exception error is thrown

Exception in thread "main" java.sql.SQLException: No suitable driver found for jdbc:odbc:srikanth
at Source)
at Source)
at

srishimoga
Автор

You really need to make an effort in naming your variables. They have to be explicit from the first sight. abc or vineet is not explicit even if it is only an example.

WarrioW