Yes, that will definitely cause the problem you are seeing. Nice catch!
Please file a bug report here so that we can update the plugin to accept
your driver name as well as the current one that it recognizes:
http://sourceforge.net/p/squirrel-sql/bugs/
Rob
On Sun, Feb 17, 2013 at 10:53 AM, Marcin Krol <mr...@gm...> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello Robert,
>
> I think I know why extended db2 error. In DB2Plugin.sessionStarted there
> is this code:
>
> // Install DB2JCCExceptionFormatter iff we're using the JCC driver
> try
> {
> if
>
> (JCC_DRIVER_NAME.equals(session.getMetaData().getJDBCMetaData().getDriverName()))
> {
> session.setExceptionFormatter(new DB2JCCExceptionFormatter());
> }
>
>
> ..
> public static final String JCC_DRIVER_NAME = "IBM DB2 JDBC Universal
> Driver Architecture";
>
> When I run the test code on DB2 9.7 IBM-provided driver (db2jcc.jar,
> db2jcc_license_cu.jar), I get this name:
>
>
> DatabaseMetaData md = con.getMetaData();
> System.out.println("Driver name: " + md.getDriverName());
>
> output:
>
> Driver name: IBM Data Server Driver for JDBC and SQLJ
>
>
> In my experience, this driver works perfectly with SquirrelSQL 3.4,
> I've had no problem using it. I also am able to get extended error codes
> like this, pretty much copy from Squirrel (your?) code:
>
> Method getSqlca = t.getClass().getMethod("getSqlca", (Class[]) null);
> Object sqlca = getSqlca.invoke(t, (Object[]) null);
>
> // String msg = sqlca.getMessage();
> Method getMessage = sqlca.getClass().getMethod("getMessage", (Class[])
> null);
> String msg = getMessage.invoke(sqlca, (Object[]) null).toString();
>
> output:
>
> "DBO.TEST5" is an undefined name.. SQLCODE=-204, SQLSTATE=42704,
> DRIVER=4.13.127
> Exception in thread "main" java.lang.NullPointerException
> at test.TestDB2.main(TestDB2.java:60)
>
>
>
> Robert Manning wrote:
> > If you have the DB2 plugin loaded, it will attempt get "human-readable"
> > messages using DB2-specific classes in the JDBC driver. Check to see
> > that you have the DB2 plugin loaded (Plugins -> Summary -> Internal Name
> > == db2)
> >
> > Rob
> >
> > On Fri, Feb 15, 2013 at 7:43 AM, Marcin Krol <mr...@gm...
> > <mailto:mr...@gm...>> wrote:
> >
> > Hello everyone,
> >
> > I have specified "errors=full" in Driver properties tab in Alias
> > properties, but I still get only typical error code:
> >
> >
> > Error: DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=OWNER,
> > DRIVER=4.13.127
> > SQLState: 42703
> > ErrorCode: -206
> >
> >
> > The same query when ran in db2 cmdline tool:
> >
> > db2 => select * from sysibm.systables where owner = 'SAM' and type
> > = 'T';
> > SQL0206N "OWNER" is not valid in the context where it is used.
> > SQLSTATE=42703
> >
> >
> > Is there a way of getting a message accompanying error code in Squirrel?
> >
> >
> > Regards,
> > Marcin Krol
>
> -
>
> ------------------------------------------------------------------------------
> Free Next-Gen Firewall Hardware Offer
> Buy your Sophos next-gen firewall before the end March 2013
> and get the hardware for free! Learn more.
> http://p.sf.net/sfu/sophos-d2d-feb
> _______________________________________________
> Squirrel-sql-users mailing list
> Squ...@li...
> <mailto:Squ...@li...>
> https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.14 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iQEcBAEBAgAGBQJRIP0CAAoJEFMgHzhQQ7hO6yMH/iJW6hkC+PdzOHHdoq2KFPgm
> pPDp7IOVMHrhxetjFmQJ5SYpOJYGrGZCAHwOXQyFYA7Yc6e58D7T3khCMQ4nF+HU
> 1qyMoto33q2rVbHXiaNZt0FodvcqHCH7rvfhypfw93YTFPlbTo4MWUUAMyKoSXWV
> Zym8cd6hXd7TAAwtCJwYPqOgVu3oYJY0yn6Ru3d9329uZxn+CkA6vo621vN4G/7i
> B9plKGR13bD0hiNUngGFLLRoS1ZVyJWAW3aY9X5unh4DIzMXONtdz5kw+4nd+vhs
> xOyUjcqdNjqk2KBPumGBUIViAuAA+GbvFJNnkSRShe5cPN8RmiSvtND8w7gFXfY=
> =HsDZ
> -----END PGP SIGNATURE-----
>
|