Make sure you have started the SAP MaxDB X Server
(communication server).
More information: Starting the X Server
Note that you must start X Server even if the Java application and the database are located on the same computer.
Also refer to the Java Manual in SAP MaxDB Documentation