This is just a wild guess, but maybe 'userid' and 'username' are
column names? Did you use MySQL or PostgreSQL before, and it's lower
case there? The SQL standard says identifiers should be converted to
uppercase if not quoted, and H2 (and many other databases) do that
that (but not MySQL and PostgreSQL). If this is the case, solutions
would be: create the table using quoted lowercase identifiers: CREATE
TABLE "abc"("userid" INT,...)
If it's not this problem, I suggest you ask in the Spring forum.
Thomas
On 8月14日, 上午4时10分, "Thomas Mueller" <thomas.tom.muel...@gmail.com>
wrote:
> Hi,
>
> This is just a wild guess, but maybe 'userid' and 'username' are
> column names? Did you use MySQL or PostgreSQL before, and it's lower
> case there? The SQL standard says identifiers should be converted to
> uppercase if not quoted, and H2 (and many other databases) do that
> that (but not MySQL and PostgreSQL). If this is the case, solutions
> would be: create the table using quoted lowercase identifiers: CREATE
> TABLE "abc"("userid" INT,...)
>
> If it's not this problem, I suggest you ask in the Spring forum.
>
> Thomas
>
> On 8/13/07, johnh...@gmail.com <johnh...@gmail.com> wrote:
>
>
>
>
>
> > when i use Spring jdbcTemplate.queryForList() to search H2
> > data,return result like this:list=[{USERID=admin, USERNAME=manager}],
> > but i need result like this :list=[{userid=admin, username=manager}],
> > Whether have what allocation can attain my request?- 隐藏被引用文字 -
>
> - 显示引用的文字 -
> I need write sql like this:
> insert table testtbl("tid") values('a');
Yes.
> if use
> insert into testtbl (tid) values('a')
> Column TID not found [42S22-55]
The reason is, unquoted names are converted to uppercase according to
the ANSI SQL-92 standard. H2 supports the ANSI SQL-92 standard, so it
must say 'Column not found'. If it is absolutely required it could be
implemented in the MySQL / PostgreSQL compatibility layer.
> so it has new problem
I understand, but why do you need to use 'insert into testtbl (tid)
values('a')'? Why not 'insert table testtbl("tid") values('a')'?
Thanks,
Thomas
Many thanks Thomas Mueller the so warmhearted help , give me a lot of
helps. ^L^
On 8月15日, 上午1时23分, "Thomas Mueller" <thomas.tom.muel...@gmail.com>
wrote:
> Hi,
>
> > I need write sql like this:
> > insert table testtbl("tid") values('a');
>
> Yes.
>
> > if use
> > insert into testtbl (tid) values('a')
> > Column TID not found [42S22-55]
>
> The reason is, unquoted names are converted to uppercase according to
> the ANSI SQL-92 standard. H2 supports the ANSI SQL-92 standard, so it
> must say 'Column not found'. If it is absolutely required it could be
> implemented in the MySQL / PostgreSQL compatibility layer.
>
> > so it has new problem
>
> Thanks,
> Thomas
I will add a feature request:
"In the MySQL and PostgreSQL, use lower case identifiers by default
(DatabaseMetaData.storesLowerCaseIdentifiers = true)"
However I think the current behavior will be still the default.
Thomas