Subject Re: [Firebird-Java] Re: Firebird 2.1 Character sets and Tomcat
Author Mark Rotteveel
If I run this on Java 6 update 15 using Jaybird 2.1.6_JDK6 I get the
expected result (ie WIN1252).

What Java version and exact driver variant are you using?

I have some remarks on your code:
1) calling newInstance() is not necessary (it originates somewhere in
the past with buggy MySQL drivers)
2) calling DriverManager.registerDriver is unnecessary, this is done by
the classloader when loading the FBDriver
3) Why are you using DIALECT 1? For most intents and purposes, DIALECT 1
should be considered deprecated and not be used.

Mark

iananewby wrote:
> Hi folks,
>
> I've tried the following test program:
>
> public static void main(String[] args) {
>
> try {
> Driver driver = (Driver) Class.forName("org.firebirdsql.jdbc.FBDriver").newInstance();
> DriverManager.registerDriver(driver);
> Properties p = new Properties();
> p.setProperty("user","aktivate");
> p.setProperty("password","s1v2n3f9");
> p.setProperty("encoding","WIN1252");
> p.setProperty("sqlDialect","1");
> Connection con = DriverManager.getConnection("jdbc:firebirdsql://localhost/C:/!Development/Aktiv2/DataSafe/Aktiv.fdb", p);
> System.out.println(((FBConnection) con).getIscEncoding());
> con.close();
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
>
> The issue is the getIscEncoding returns NONE. Shouldn't this return WIN1252 or am I going mad?


--
Mark Rotteveel