I keep getting an error message when trying to create a new connection for a db2 database:
COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] SQL1013N The database alias name or database name "db_name" could not be found. SQLSTATE=42705
I definitely made sure to specify the server name, port, and user name, etc correct but no matter what type of jdbc connection string used, jasper keeps failing.
The fix for me was to actually create a new IBM DB2 ODBC data source as follows:
- Administrative Tools -> Data Sources
- System DNS -> Add -> IBM DB2 ODBC DRIVER.
- Fill in a data source name for this connection.
- Add a new database alias. Fill in user and password information.
- Under TCP/IP tab, fill in the database name and alias (I had it set to my database name), host name, and port.
Back in iReport, when you create a new database connection, make sure the configuration looks like this:
- JDBC Driver=COM.ibm.db2.jdbc.app.DB2Driver
- JDBC URL=jdbc:db2:DB_NAME
Make sure to enter the right database name, user name, and password. Test the connection and it should work.