DEV Community

Faizan Firdousi
Faizan Firdousi

Posted on

Day 1 of #100DaysOfJavaBackend

I learned about:

𝗘𝘅𝗰𝗲𝗽𝘁𝗶𝗼𝗻 𝗛𝗮𝗻𝗱𝗹𝗶𝗻𝗴:
-Types of exceptions: checked and unchecked.
-How try-catch works, along with Exception classes and their hierarchy (see image).
-How to create your own exceptions using throw and how to use throws in a method.

𝗝𝗗𝗕𝗖:
I gained an understanding of how JDBC connects Java to databases and the code required to make this happen. I learned to:
-Connect to a database using a URL and password as input to the Connection interface, and run queries while storing the results in an instance of ResultSet.
-Iterate through the ResultSet object using a while loop, extracting data for each row with methods like getInt() and getString().

Image description
Image descriptionToday,
-Handle SQL exceptions in a try-catch block, which may arise from syntax errors in Java or in SQL queries.

Top comments (0)