JDBC to the Rescue

I just read a chapter on the JDBC. This allows me to access databases from my Java code. Now I have the power to write CRUD apps. Yeah. So far I have written some code that uses Statements to do basic querying. I have also delved into PreparedStatements to insert and update.

To test out and play with this capability, I downloaded and installed the latest MySQL database. It is taking a while to get used to MySQL database administration. I also got MySQL Connector/J so that my JDBC can talk to the MySQL database. So far it works like a charm.

I have studied and modified a little bit of code that uses an AbstractTableModel and JTable. This seems to be quite the powerful combinatoin. It is also something that will take a while to learn. Now the world of databases it at my fingertips. Perhaps I shall try to connect to an Oracle database with JDBC as well.

Towers of Hanoi

In my Java class this semester, we went over the Towers of Hanoi problem during our study of recusion. The recusrive solution is elegant. It is also simpler than any iterative solution. We did not code a solution. We just studied one intently to understand the recursive nature of it.

Recently I saw one of the sample problems you need to solve during a Facebook interview. One of them is the Towers of Hanoi problem. Nice. Facebook even let's you code the thing in Java. It has to work correctly. And you need to complete the thing in 45 minutes.

Not sure if I can meet that metric. But at least I have seen the problem and solution before. I guess I could google the code. That would be cheating. I feel good about what my Java college class is teaching me.