To obtain an ODBC connection, creating a DSN is not always necessary. It can be done in the following way for sybase iq db:

String url = "jdbc:odbc:Driver={Sybase IQ};Compress=NO;" +
"TCPIP{host=<IPADDRESS>;port=<PORTNUMBER>};" +
"AutoStop=YES;ServerName=<DBSERVERNAME>";

Connection con = DriverManager.getConnection(url, <USERNAME>,
<PASSWORD>);

Same can be done with most of the databases. But the property names differ for different databases. Best way to find out the property names is to create a File DSN from the ODBC administrator. The DSN file created will have the property names that can be used in the connection string.