problems with the apache ij tool, encoding error?
Hello
I try running a method in the ij.class from within my application. I always receive an error, which I believe is to do with encoding.
int i = org.apache.derby.tools.ij.runScript(getDatabase("test").getConnection(),
in,"ASCII", System.out,"UTF8");
gives me:
Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: org.apache.derby.iapi.tools.i18n.LocalizedResource.getNewEncodedOutput(Ljava/io/OutputStream;Ljava/lang/String;)Lorg/apache/derby/iapi/tools/i18n/LocalizedOutput;
at org.apache.derby.tools.ij.runScript(Unknown Source)
The method getNewEncodedOutput() is not in the class specified, as indicated by the exception. However, I was hoping the problem was me not using the encoding correct. I have tried different comb. of "ASCII" and "UTF8".
Regard
Fluid
[954 byte] By [
Fluida] at [2007-10-3 10:30:56]

> Hello
> I try running a method in the ij.class from within my
> application. I always receive an error, which I
> believe is to do with encoding.
> > int i =
> org.apache.derby.tools.ij.runScript(getDatabase("test"
> ).getConnection(),
> in,"ASCII", System.out, "UTF8");
> gives me:
> Exception in thread "AWT-EventQueue-0"
> java.lang.NoSuchMethodError:
> org.apache.derby.iapi.tools.i18n.LocalizedResource.get
> NewEncodedOutput(Ljava/io/OutputStream;Ljava/lang/Stri
> ng;)Lorg/apache/derby/iapi/tools/i18n/LocalizedOutput;
>
> at
> org.apache.derby.tools.ij.runScript(Unknown Source)
>
> The method getNewEncodedOutput() is not in the class
> specified, as indicated by the exception. However, I
> was hoping the problem was me not using the encoding
> correct. I have tried different comb. of "ASCII" and
> "UTF8".
Yeah, mismatch.
Alternatively, you could do away with ij if you are simply running a script. For example, if you had a script that looked like this:
CREATE TABLE HOCKEY_TEAMS(
TEAM_NAME VARCHAR(30) NOT NULL,
CITYVARCHAR(50)
)
You could simply read this file, build a query and perform a statement.executeQuery(String query);
good luck.