ODBC-combined configuration

Like the DSN-less configuration, ODBC-combined keeps server properties in freetds.conf. The difference is that your applications can refer to the server by its DSN. To make that possible, the DSN entry in odbc.ini refers to the servername entry in freetds.conf.

Example 4.5. Sample ODBC-combined odbc.ini file

	[ODBC Data Sources][13]
	JDBCdsn = Sybase JDBC Server
	
	[JDBCdsn]
	Driver          = /usr/local/freetds/lib/libtdsodbc.so
	Description     = Sybase JDBC Server
	Trace           = No
	Servername      = JDBC[14]
	Database        = pubs2
	
	[Default]
	Driver          = /usr/local/freetds/lib/libtdsodbc.so
	


Example 4.6. Sample ODBC-combined freetds.conf file

	;
	; freetds.conf
	;
	[JDBC]
	host = jdbc.sybase.com
	port = 4444
	tds version = 5.0
	


With this arrangement, an application can connect to the server in two ways, via its DSN (JDBCdsn), or its servername (JDBC).



[13] Several DSNs might be listed here. In this example, we have only one, JDBCdsn. It matches the [JDBCdsn] entry later in the file.

[14] Refers to the [JDBC] entry in freetds.conf.