Java Databases Flashcards

1
Q

How do you connect with a database with Java?

A

Need to have a JAR file that would connect with the specific database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is one important thing to do once you have done what you need to do with the database?

A

Need to close the connection with the database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the first step to add items to a database?

A

Need to create a statement and then define the statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is needed to work with a database in Java?

A
1- Java Application
2 JDBC API
3 Vendor Driver Software
4 Connection
5 Database / SQL
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Where do you get the driver to connect to a database?

A

You would get it from the vendor and download the JAR file that is needed to make the connection. And need to install on your machine. Need to add the jar file into the application to connect to the database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is one way to see your database?

A

Through an IDE to see the data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Why do you use the throw exception?

A

You want to throw the exception because then it will still run the program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the JDBC API used for

A

1- Create, read, update, and delete data in a relational database using the java programming language.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a CLOB?

A

Legal Document, Resume or other Document

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a BLOB?

A

Image, Video, Crytographic info

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is connection pooling?

A

The cost to create a new jdbc connection can be expensive in time and performance. And cost to close connection. It is an existing connection that is already in order and then it is connected to the pool which is connected to the database. It is a caching mechanism. It is a container system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a JDBC transaction?

A

A transaction is a set of actions to be carried out as a single, atomic action. Either all of the actions are carried out, or none of them are

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what is a jdbc rowset?

A

A RowSet is an object that encapsulates a set of rows from either java Database Connectivity (JDBC) result sets or tabular data sources. RowSets support component-based development models like JavaBeans, with a standard set of properties and an event notification mechanism.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a DAO?

A

responsible for interfacing with the database using JDBC code

Common Design Pattern Data Accessor Object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a JDBC driver?

A

A JDBC driver is a software component enabling a Java application to interact with a database.[1] JDBC drivers are analogous to ODBC drivers, ADO.NET data providers, and OLE DB providers.

To connect with individual databases, JDBC (the Java Database Connectivity API) requires drivers for each database. The JDBC driver gives out the connection to the database and implements the protocol for transferring the query and result between client and database.

JDBC technology drivers fit into one of four categories.[2]

JDBC-ODBC bridge
Native-API driver
Network-Protocol driver (Middleware driver)
Database-Protocol driver (Pure Java driver) or thin driver.

ava Database Connectivity (JDBC) is an application programming interface (API) for the programming language Java, which defines how a client may access any kind of tabular data, especially relational database. It is part of Java Standard Edition platform, from Oracle Corporation. It acts as a middle layer interface between java applications and database.

The JDBC classes are contained in the Java Package java.sql and javax.sql.
JDBC helps you to write Java applications that manage these three programming activities:

Connect to a data source, like a database.
Send queries and update statements to the database
Retrieve and process the results received from the database in answer to your query

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Steps to Connect to a database in Java

A

https://www.javatpoint.com/steps-to-connect-to-the-database-in-java

There are 5 steps to connect any java application with the database using JDBC. These steps are as follows:
Register the Driver class
Create connection
Create statement
Execute queries
Close connection