That problem is usually caused by an incorrect configuration of the
database connection. You will need to check that first.
If you are still having problems, I would recommend going through the
It uses a very small application to show you the basics. If you do
that, it will likely help.
It also helps if you use the same toolkit as described in the
documentation. If you use Oracle instead of MySql, for example, then
the documentation will not be able to guide you very well.