Developer edition of Sybase ASE 16 is available for download from SAP.
It also comes with their official JDBC driver sajdbc4.jar under SDK folder.
On 21/06/12 15:45, Gerd Wagner wrote:
> Am 08.06.21 um 19:55 schrieb info:
> > Metadata tab is wrong about Sybase ASE varchar/varbinary column width.
> >
> Sorry I can't reproduce your problem as I don't have access to Sybase
> ASE. I couldn't find an official docker image and tried this
> https://hub.docker.com/r/jaschweder/sybase
> but it didn't work.
>
> As the problem doesn't occur on other databases I assume it is a
> problem of Sybase or the JDBC driver.
>
> Below is a small Java program that you can use to reproduce the problem.
> If you are able to reproduce the problem this way please contact your
> database and/or JDBC driver vendor.
>
> Gerd
>
> ---------
>
> package pack;
>
> import java.sql.Connection;
> import java.sql.DriverManager;
> import java.sql.ResultSet;
> import java.sql.ResultSetMetaData;
> import java.sql.SQLException;
>
> public class PrecisionAndScaleTest
> {
> public static void main(String[] args) throws Exception
> {
> Class.forName("<yourDriverClass>");
>
> Connection con = DriverManager.getConnection(
> "<yourJdbcUrl>", "<yourUser>", "<yourPassword>");
>
> String sql = "<yourSQL>";
> ResultSet res = con.createStatement().executeQuery(sql);
> ResultSetMetaData resMetaData = res.getMetaData();
>
> // 1 means first column in <yourSQL>
> int precision = resMetaData.getPrecision(1);
> int scale = resMetaData.getScale(1);
>
> System.out.println("precision = " + precision);
> System.out.println("scale = " + scale);
> }
> }
>
|