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.
Thanks for this presentation. Sorry it didn't work on your laptop, but the points were made. Also like the links you provided.
ReplyDeleteI think it worked out okay even without the laptop. I am glad I posted it on the server just in case!
DeleteVery good presentation! I really enjoyed how practical it was because Eller students have taken both Java and SQL and this will definitely be helpful down the road at many of our future jobs
ReplyDeleteThank you Josh, I hope it is useful to some students throughout their career. If anything, at least we all know that it is possible, which could come in handy down the road.
DeleteI like SQL and Java. I want to learn more about it. Is there any website that teach me more detail? Good presentation and I really enjoy it :)
ReplyDeleteTracy
Java is created by oracle, and Oracle has some of the best documentation around. One that I found particularly helpful is: https://docs.oracle.com/javase/tutorial/jdbc/basics/processingsqlstatements.html
DeleteYou can get lost on their documentation website, I suggest doing so some day.