The driver supports User ID/password authentication. It authenticates the user to the database using a user name and password.

Take the following steps to configure user ID/Password authentication.
  • Set the User property to specify the user name that is used to connect to the database.
  • Set the Password property to specify the password.
  • Set the ServerName property to specify either the IP address or the name of the computer that is running the database server to which you want to connect.
  • Set the PortNumber property to specify the TCP port of the primary database server that is listening for connections to the database.
  • Set the InformixServer property to specify the name of the database server to which you want to connect.
  • Set the DatabaseName property to specify the name of the database to which you want to connect.

The following examples show the connection information required to establish a connection using user ID/password authentication.

Connection URL

Connection conn = DriverManager.getConnection 
("jdbc:datadirect:informix://myserver:1526;InformixServer=myinformixserver;
  DatabaseName=payroll;User=test;Password=secret);

Data Source

InformixDataSource mds = new InformixDataSource();
mds.setDescription("My Informix Data Source");
mds.setServerName("myserver");
mds.setPortNumber("1526");
mds.setInformixServer("myinformixserver");
mds.setDatabaseName("payroll");
mds.setUser("jsmith");
mds.setPassword("secret");
Note: The User and Password properties are not required to be stored in the connection string. They can also be passed separately by the application.