You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by Mike Jumper <mi...@guac-dev.org> on 2017/02/03 07:36:44 UTC

Re: Creating a new JDBC auth extension

I've done some reading on the SQLite driver, and I'm not seeing anything
stating one way or the other whether queries with multiple statements /
resultsets are supported.

Perhaps making a quick proof-of-concept would help track things down? Some
pure-JDBC test (no guac, no mybatis) with the problematic query to help
narrow down what is failing and where?

- Mike


On Tue, Jan 31, 2017 at 3:15 PM, David Landry <da...@dmwl.net> wrote:

> I posted this problem to StackOverflow, if anyone wants internet points:
> https://stackoverflow.com/questions/41969037/sqlite-mybatis-guice-throw-
> arrayindexoutofboundsexception
>
> On Thu, Jan 26, 2017 at 9:13 AM David Landry <da...@dmwl.net> wrote:
>
> > Good point.
> >
> > On Thu, Jan 26, 2017, 2:36 AM Mike Jumper <mi...@guac-dev.org>
> > wrote:
> >
> > On Wed, Jan 25, 2017 at 7:47 PM, David Landry <da...@dmwl.net> wrote:
> >
> > > Could it be a problem with mapping from JDBC VARCHAR to SQLite's
> INTEGER?
> > > Actually, I'm a little confused about why the MySQL JDBC type is a
> > VARCHAR,
> > > but Postgres has them as INTEGER (especially since the underlying type
> is
> > > an integer for both DBs).
> > >
> > >
> > Internal (within the Java side of Guacamole) storage of the database IDs
> is
> > strings, because connection identifiers are abstracted as generic strings
> > at the extension API level. The fact that those strings are actually
> > integers and translate into integer database IDs is an implementation
> > detail of the JDBC auth backend. These were initially mapped as VARCHAR
> > since they are, indeed, strings, and the expectation was that the
> database
> > engine would handle the conversion, and MySQL did behave that way.
> > PostgreSQL, on the other hand, did not do the same implicit conversion,
> and
> > it was necessary to explicitly cast to integer.
> >
> > It's certainly a quirk, but assuming SQLite doesn't implicitly convert
> like
> > MySQL, I don't think that it would likely result in an
> > ArrayIndexOutOfBoundsException. I'd expect any error due to the type of
> the
> > column to be thrown through the database engine out through the JDBC
> > driver, not prior to the query being shipped to the database engine when
> > the PreparedStatement is being populated.
> >
> > - Mike
> >
> > --
> >
> > ---
> >
> > David Landry
> >
> --
>
> ---
>
> David Landry
>