There is a difference between jConnect 5 and jConnect 6 JDBC drivers in the behavior of ResultSetMetaData::getColumnLabel() and ResultSetMetaData::getColumnName():
jConnect 5 – both APIs return the column label.
jConnect 6 – getColumnLabel() returns the column label, while getColumnName() returns the actual name of the column.
If a client application uses getColumnName() in jConnect 5, you may need to change it to use getColumnLabel() instead. For example, let’s say that an application in EAServer 5.x retrieves a column label by calling getColumnName(), then retrieves the data using ResultSet.getString(columnLabel). Because EAServer 6.0 uses jConnect 6 by default, this application now fails, because it is trying to since EAServer 6.0 uses JConnect 6 by default.Here is a code sample to further illustrate this situation:
package test;
import java.sql.*;
public class TestJDBC {
public static void main(String[] args) throws Exception{
// Class.forName("com.sybase.jdbc2.jdbc.SybDriver");
Class.forName("com.sybase.jdbc3.jdbc.SybDriver");
Connection conn = DriverManager.getConnection("jdbc:sybase:Tds:i18n280:4000/tck141db", "cts1", "cts123");
PreparedStatement ps = conn.prepareStatement("select my_name=name from sysobjects");
ResultSet rs = ps.executeQuery();
System.out.println("Column One: " + rs.getMetaData().getColumnName(1));
System.out.println("Column One's label : " + rs.getMetaData().getColumnLabel(1));
ps.close();
conn.close();
}
}