0% found this document useful (0 votes)
9 views2 pages

Database JDBC Interview Questions

The document provides an overview of databases, explaining their purpose, the role of DBMS, and the use of SQL for database operations. It also introduces JDBC as an API for Java applications to interact with relational databases and outlines the steps involved in using JDBC. Key concepts such as relations, fields, records, and queries are defined to enhance understanding of database management.

Uploaded by

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

Database JDBC Interview Questions

The document provides an overview of databases, explaining their purpose, the role of DBMS, and the use of SQL for database operations. It also introduces JDBC as an API for Java applications to interact with relational databases and outlines the steps involved in using JDBC. Key concepts such as relations, fields, records, and queries are defined to enhance understanding of database management.

Uploaded by

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

Database and JDBC Interview Questions & Answers

1. What is a Database?
- A Database is a structured collection of data that is stored, managed, and accessed
electronically.

2. Why do we need a Database?


- To efficiently store, retrieve, and manage large amounts of data securely and consistently.

3. What is DBMS?
- DBMS (Database Management System) is software that allows users to create, manage, and
manipulate databases (e.g., MySQL, PostgreSQL, MongoDB).

4. What is SQL?
- SQL (Structured Query Language) is a standard language used to interact with relational
databases, performing operations like SELECT, INSERT, UPDATE, and DELETE.

5. What is a Relation in MySQL?


- A Relation is a table in a relational database, consisting of rows and columns.

6. What is a Field in a Table?


- A Field is a single column in a table that stores a specific type of data.

7. What is a Record in a Table?


- A Record (Row) is a single entry in a table, representing a set of related data.

8. What is a Query?
- A Query is a request to perform operations (like retrieval, insertion, or deletion) on a database
using SQL.

9. What is JDBC?
- JDBC (Java Database Connectivity) is an API that allows Java applications to interact with
relational databases.

10. What are the Steps of JDBC?


- 1. Load the Driver:
Class.forName("com.mysql.cj.jdbc.Driver");

- 2. Establish Connection:
Connection con = DriverManager.getConnection(url, user, password);

- 3. Create Statement:
Statement stmt = con.createStatement();

- 4. Execute Query:
ResultSet rs = stmt.executeQuery("SELECT * FROM users");

- 5. Process Result:
while (rs.next()) {
System.out.println(rs.getString("name"));
}

- 6. Close Connection:
con.close();

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