You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by RAPPAZ Francois <fr...@unifr.ch> on 2009/10/30 14:28:11 UTC

column not found from java

With a database in a jar file, I can access it from ij with the url
ij.connection.doc=jdbc:derby:jar:(./docentries.jar)docentries
My derby.properties contains also
derby.ui.codeset=utf8

Once connected a statement 
select data from authors where name1 like 'Foffi%'
works correctly.


Now, from my java class, I connect with
jdbc:derby:jar:(./docentries.jar)docentries;derby.ui.codeset=utf8

but I can't run any select statement: I still got a 
Column name1 not found 

Thanks for any clue

François 

(In my previous message please read "I use two files instead" of "I use to file" ... ain't easy to use derby; I'm tired)

Re: column not found from java

Posted by Rick Hillegas <Ri...@Sun.COM>.
Hi François,

If the error text below is exactly what  Derby reported, then that 
indicates that Derby is looking for a column called "name1". If you 
don't double-quote the column name, then Derby internally converts the 
column name to uppercase: NAME1. You  may be up against the distinction 
between ordinary identifiers and double-quoted identifiers. Make sure 
that the query you're issuing really is what you wrote below rather than

select data from authors where "name1" like 'Foffi%'


For more information on identifiers, please see the following section in 
the Derby Reference Guide: 
http://db.apache.org/derby/docs/10.5/ref/ref-single.html#crefsqlj34834

Hope this helps,
-Rick





RAPPAZ Francois wrote:
> With a database in a jar file, I can access it from ij with the url
> ij.connection.doc=jdbc:derby:jar:(./docentries.jar)docentries
> My derby.properties contains also
> derby.ui.codeset=utf8
>
> Once connected a statement 
> select data from authors where name1 like 'Foffi%'
> works correctly.
>
>
> Now, from my java class, I connect with
> jdbc:derby:jar:(./docentries.jar)docentries;derby.ui.codeset=utf8
>
> but I can't run any select statement: I still got a 
> Column name1 not found 
>
> Thanks for any clue
>
> François 
>
> (In my previous message please read "I use two files instead" of "I use to file" ... ain't easy to use derby; I'm tired)
>