
Concept explainers
Any comments i could add to this?
package attendance;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
public class SqliteDB {
Connection conn = null;
Statement stmt = null;
public SqliteDB() throws ClassNotFoundException {
//try to connect with db
try {
Class.forName("org.sqlite.JDBC");
// db parameters
String url = "jdbc:sqlite:C:/sqlite/db/attendance.db";
// create a connection to the
conn = DriverManager.getConnection(url);
System.out.println("Connection to SQLite has been established.");
} catch (SQLException e) {
System.out.println(e.getMessage());
}
}
public void executeQuery(String query) {
try {
this.stmt = conn.createStatement();
stmt.execute(query);
}catch (Exception e) {
System.out.println(e);
}
}
public void closeConnection() {
try {
this.conn.close();
}catch( Exception e) {
System.out.println(e);
}
}
}

Step by stepSolved in 2 steps

- What happens to the existing rows of a table if the DEFAULT value of a column is changed?arrow_forwardSave the changes permanently to the database.arrow_forwardWhich of the following is a correct statement? a. A commit is issued implicitly when a user exits SQL Developer or SQLPlus. b. A commit is issued implicitly when a DDL command is executed. c. A commit is issued automatically when a DML command is executed. d. All of the above are correct. e. Both a and b are correct. f. Both a and c are correct.arrow_forward
- Which of the following SQL statements is invalid and returns an error message? ALTER TABLE books ADD CONSTRAINT books_pubid_uk UNIQUE (pubid); ALTER TABLE books ADD CONSTRAINT books_pubid_pk PRIMARY KEY (pubid); ALTER TABLE books ADD CONSTRAINT books_pubid_nn NOT NULL (pubid); ALTER TABLE books ADD CONSTRAINT books_pubid_fk FOREIGN KEY (pubid) REFERENCES publisher (pubid); All of the above statements are invalid.arrow_forwardWhat is a NULL value?arrow_forwardAttempt to view the structure of the HOMEWORK13 view.arrow_forward
- In Chapter 11, you created the most recent version of the MarshallsRevenue program, which prompts the user for customer data for scheduled mural painting. Now, save all the entered data to a file that is closed when data entry is complete and then reopened and read in, allowing the user to view lists of customer orders for mural types.arrow_forwardWhich of the following statements declares an object to represent the pseudo-random number generator in a procedure? a. Dim randGen As New RandomNumber b. Dim randGen As New Generator c. Dim randGen As New Random d. Dim randGen As New RandomObjectarrow_forwardThe SERVICE_REQUEST table uses the CHAR data type for the DESCRIPTION and STATUS fields. Is there an alternate data type that could be used to store the values in these fields? Justify your reason for choosing an alternate data type or for leaving the data type as CHAR.arrow_forward
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage LearningProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
- Np Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:CengageC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning



