Here is the Java class API that Oracle put together for SQL.
To setup a Java class to talk to a SQL database you must have credentials for the DBMS and know the driver for the DB. You can generally talk to your DB administrator for this information if you do not know it. For this demonstration, I will use the Department of Computer Science Oracle Database driver, since I know it and how to connect to it.
A general overview of how to connect to the Database:
- Establish a connection to the Database.
- DriverManager.getConnection(<driver>,<username>,<password>)
- Create a Statement and execute a Query.
- Capture the ResultSet and process returned data
- Close the connection
In class I will show you the details of the above steps and how to process the ResultSet.