Hi I have a url in a java file which is connectiong to database setup on linux
url is jdbc:informix-sqli://sc.px-dc.dl.com :5100/cb:INFORMIXSERVER=cc
Now I am getting following exception. here I am assuming that as database and file is on same linux server so user name and password for database is not required. network is running.database is up.and on command line i just login to linux machine and i can access database using dbaccess command means no seprate user name and password for database.only linux user name i used.
com.dhl.auditdatamgr.exceptions.DatabaseException: Unable to connect to database. at com.dhl.auditdatamgr.utils.db.DriverDBService.getConnection(DriverDBService.java:61) at com.dhl.auditdatamgr.dao.AuditDAO.setDetailedAuditData(AuditDAO.java:60) at com.dhl.auditdatamgr.process.AuditDataHandler.main(AuditDataHandler.java:105) Caused by: java.sql.SQLException: com.informix.asf.IfxASFException: Attempt to connect to database server (cc) failed. at com.informix.jdbc.IfxSqliConnect.<init>(IfxSqliConnect.java:1026) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:79) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:43) at java.lang.reflect.Constructor.newInstance(Constructor.java:313) at com.informix.jdbc.IfxDriver.connect(IfxDriver.java:254) at java.sql.DriverManager.getConnection(DriverManager.java:538) at java.sql.DriverManager.getConnection(DriverManager.java:210) at com.dhl.auditdatamgr.utils.db.DriverDBService.getConnection(DriverDBService.java:55) ... 2 more
DBAccess (and i4gl / isql ) use the settings in the $INFORMIXDIR/etc/sqlhosts file (for example TCP/IP) to connect to the database. I don't remember how these tools authenticate (maybe you have to be in the INFORMIX group). If you are logged in as the informix user, then you are the DBA - and no authentication is required (other than the normal UNIX).
Connecting by using JDBC, is a different protocol. You will need to supply a user and password for a database user who has the correct database schema rights.
Which version of Informix are you connecting to? Sorry I cannot be more helpful, but I'm a few thousand miles from my Informix manuals (and it�s been a while since I used it)... Have you checked the IBM web site? IBM bought Infomix becasue DB2 is so slow... [Sorry about that - could not resist it ).