Practice JDBC API using Oracle SQL

Overview

In this project, we practiced JDBC API by running DDL and DML commands using static SQL, prepared statement, or updatable result set. The commands include INSERT, UPDATE, DELETE, CREATE, DROP, etc.

query package

unknown package

update package

Github

Project Walk-Through

AnySQL.java (Part 1)

This part of the code tries executing the user input and determines whether the input is a SELECT query, UPDATE/DELETE/INSERT query, or not a valid SQL query, and then provides the corresponding output to the console.

AnySQL.java (Part 2)

If the user input is a valid SELECT command, the program will output the query result to the console as a table.

JDBCUtilities.java (Database Connection)

This utility class is used to establish a connection through JDBC API to the Oracle database.

Console / Terminal Demonstration

This is where a user interacts with the program. The user can freely input anything, and the program will check the validity of the input. 

If the input is a valid SQL command, then the program will execute the command and return a result. However, if the input is not a valid SQL command, the program will show a warning message to the user as demonstrated in the screenshot.