March 14, 2005: Sybase and jdbc

In my current project the (websphere) j2ee application connects to a Sybase database. The database uses user- and application-based security. So besides the standard username/password the applicationname must be provided. This can be added easily by using the property 'applicationname':

SybDriver sybDrvr = (SybDriver) Class.forName("com.sybase.jdbc2.jdbc.SybDriver").newInstance();
Properties props = new Properties();
props.put("user","");
props.put("password","");
props.put("applicationname","");
con = DriverManager.getConnection("jdbc:sybase:Tds::?ServiceName=",props);

However, when using a datasource and connectionpooling (com.sybase.jdbc2.jdbc.SybConnectionPoolDataSource) this property is only available as APPLICATIONNAME (mind the uppercase). Since the documentation of the driver is quite scarce it took me some time to find out, also because this feature is not available with the Oracle driver.
Posted by Aino at 10:01