How to fix the “#1046: No database selected” error in phpMyAdmin

Here is a simple solution to the “#1046: No database selected” error when trying to import a .sql file in phpMyAdmin. Solution #1: Before importing In phpMyAdmin, click on the Export tab from the home page of phpMyAdmin, without selecting any database. phpMyAdmin will then include instructions to create and select the database when you […]

How to get an Integer from a Java resultset

By default, ResultSet.getInt(…) only returns an int. If the database value is null, it will return 0. This is already covered in the documentation: “The default for ResultSet.getInt when the field value is NULL is to return 0″. This is also the case for resultset.getFloat(). This irritating behavior can easily be fixed with the wasNull […]