We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › [solved] encoding from result set DB2
Page Index Toggle Pages: 1
[solved] encoding from result set? DB2 (Read 1324 times)
[solved] encoding from result set? DB2
Mar 3rd, 2009, 5:09pm
 
Hello,
i am using Processing to crete an exe that performs a query to a db2 databse and exports a textfile with the results.
Everything works fine but if i export the application and click on the exe it creates an empty text file and i get a "unsupported encoding for result set column".
How to fix this?
Thanks for any help.
GC
Re: encoding from result set? DB2
Reply #1 - Mar 4th, 2009, 3:53pm
 
could depends on the fact that on my machine i have more than one JRE?
I have jdk1.6.0_06, jre1.6.0_06, jre1.6.0_07, jre6.
When exported and used on another machine it works perfectly, but on my machine only works in the Processing IDE.
Re: encoding from result set? DB2
Reply #2 - Mar 4th, 2009, 5:30pm
 
Do your machines have a different locale setting?
Re: encoding from result set? DB2
Reply #3 - Mar 4th, 2009, 5:46pm
 
HI, how do i discover that?
doind java -version here's what i get:

java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)
Re: encoding from result set? DB2
Reply #4 - Mar 4th, 2009, 6:33pm
 
I was thinking about the system's locale, on Windows you can see that on the Configuration panel, Regional settings.

Java is supposed to take the system's (or user?) locale.
You can see it in Processing with:

println(Locale.getDefault().getCountry());

Not sure that's the problem, nor why there is a different behavior in Processing and exported app, but it is worth checking.
Re: encoding from result set? DB2
Reply #5 - Mar 5th, 2009, 9:51am
 
Hello PhiLho and thanks for your reply.
It seems to be IT if printed within the IDE and in a textfield for the exported app. Could it be that on the db the columns are defined some as char and some as decimal.
To retrieve the content of column i use
String myColumnValue = rs.getString(i) where rs is ResultSet.
???
Thanks for any more tip.
P.S i am trying to prototype a small data-visualization app: it should connect to the db and generate a graphic based on the acquired data (in real-time, let's say). Also (and here is the problem) it should export a txt file for the data acquired.
Re: encoding from result set? DB2
Reply #6 - Mar 5th, 2009, 3:02pm
 
OK, found the solution.
In control panel > Java control panel i wanted to see which jre the apps (exported from Processing or standalone java apps) points to.
Surprisingly they point to all THREE the jre s i have on my machine. But two out of three were missing the charset.jar.
I just copied the charset.jar where it was missing and everything runs perfectly.

Success! I can continue my exploration! Wink
GC
Page Index Toggle Pages: 1