[hotjoe.com] HotJoe Java Help Forums
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Visit java.com
Please send email if you are having login problems - see the posts below for more info.
Hotmail and Yahoo! users - please see the Hotmail post or the Yahoo! post for information on lost emails.
Jisql version 2.0 now available  XML
Forum Index » Jisql
Author Message
stdunbar

Newbie
[Avatar]

Joined: 06/22/2005 14:51:37
Messages: 703
Location: Superior, CO, USA
Online

Yes, after this many years people are still using Jisql. I've updated it and I've tried to include most suggestions that I've received over the years. I think I've gotten it but don't be afraid to speak up - let me know if something is missing!

Jisql can be downloaded from the normal places. Take a look and give me any feedback.

This message was edited 1 time. Last update was at 01/12/2010 10:23:16


Thanks for using the forums at hotjoe.com
[WWW] [Yahoo!] [ICQ]
tamiij

Newbie

Joined: 02/16/2009 08:32:40
Messages: 3
Offline

I'm sure this is something I've done wrong, but I'm getting a message about 'Bad version number in .class file' when attempting to run against the updated version (which I'm very excited about!)

Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:18
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:26
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)


I'm trying to run as follows:
/opt/jboss/jdk1.5.0_07/bin/java -classpath lib/jisql.jar:lib/jopt-simple-3.2.jar:lib/javacsv.jar:/lib/jt400-6.0.jar com.xigole.util.sql.Jisql -user %user% -password %pass% -driver com.ibm.as400.access.AS400JDBCDriver -cstring jdbc:as400://%dbname%

I also tried to run against the new version with scripts that were running without issue on the older version that we've been using for a little over a year now. (script exists in jisql/slic_queries, thus classpath ../lib)

JAVA_HOME=/opt/jboss/jdk1.5.0_07
$JAVA_HOME/bin/java -classpath ../lib/jisql.jar:../lib/jt400-6.0.jar \
com.xigole.util.sql.Jisql \
-driver com.ibm.as400.access.AS400JDBCDriver \
-user %user% \
-pf /home/weblogic/jisql/input/3.txt \
-cstring jdbc:as400://%dbname%\
-input check_slic_stop_status.sql

Sorry if this is a rookie mistake. I'll keep working on it to see if I can resolve.

Thanks,
Tamii
stdunbar

Newbie
[Avatar]

Joined: 06/22/2005 14:51:37
Messages: 703
Location: Superior, CO, USA
Online

No mistake - I compiled with Java 6. I'll post an updated one with Java 5. Otherwise, there is an ant build file included with the distribution that would allow you to build your own.

Thanks for pointing this out!

Thanks for using the forums at hotjoe.com
[WWW] [Yahoo!] [ICQ]
tamiij

Newbie

Joined: 02/16/2009 08:32:40
Messages: 3
Offline

Thanks so much for the FAST reply! I also had java6 on my machine. I tried with that and had to update my driver, but it's working like a charm now!

Thanks again!
Tamii
tamiij

Newbie

Joined: 02/16/2009 08:32:40
Messages: 3
Offline

Has the -pf option to pass in the password from a text file been removed in the latest version?

Older version usage included the following:
-pf specifies the name of a file that contains the password to log into a database server with.
The first line of file should contain the password and nothing else.

However, I don't see it in the usage for the 2.0 release.

This was super useful for cron.

Thanks,
Tamii
stdunbar

Newbie
[Avatar]

Joined: 06/22/2005 14:51:37
Messages: 703
Location: Superior, CO, USA
Online

I'm not sure how I removed that but it is in an older subversion rev - let me fix it and I'll post a 2.0.1 version. Sorry for the confusion.

Thanks for using the forums at hotjoe.com
[WWW] [Yahoo!] [ICQ]
stdunbar

Newbie
[Avatar]

Joined: 06/22/2005 14:51:37
Messages: 703
Location: Superior, CO, USA
Online

The -pf is back - I don't quite know how I deleted it and then missed it but it's back.

Thanks for using the forums at hotjoe.com
[WWW] [Yahoo!] [ICQ]
mkienenb

Newbie

Joined: 01/25/2010 13:51:47
Messages: 7
Offline

I grabbed the latest download (2010-01-25 3:45pm EST), and I get this error:



Jisql v2.0.1 copyright (c) 2010 Scott Dunbar (scott@xigole.com)
[...]


java -classpath .../ojdbc14_g.jar:.../jisql_2/lib/jisql.jar com.xigole.util.sql.Jisql -user ... -password ... -driver oracle.jdbc.driver.OracleDriver -cstring jdbc:oracle:thin:@...:1521:...

java -version
java version "1.6.0_0"
OpenJDK Runtime Environment (IcedTea6 1.6.2) (suse-0.1.1-x86_64)
OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)

Changing the location of jisql.jar to point to my old jisql from fall 2009 works fine.
[Email]
stdunbar

Newbie
[Avatar]

Joined: 06/22/2005 14:51:37
Messages: 703
Location: Superior, CO, USA
Online

Sorry if it wasn't clear from the the docs but Jisql now has one required and one optional dependency. The required dependency is on jopt-simple. This is included in the "lib" directory of the distribution.

If you use the CSV output or if you compile the default formatter it is dependent on JavaCSV which is also included in the "lib" directory.

If you add lib/jopt-simple-3.2.jar to your classpath and, optionally, lib/javacsv.jar you should be good to go.

Thanks for using the forums at hotjoe.com
[WWW] [Yahoo!] [ICQ]
mkienenb

Newbie

Joined: 01/25/2010 13:51:47
Messages: 7
Offline

Oops.

Yes, it was obvious from the docs -- once I read them again.

Sorry about that -- I assumed that they hadn't changed since the last time I read them

Thanks for the RTM
[Email]
mkienenb

Newbie

Joined: 01/25/2010 13:51:47
Messages: 7
Offline

If you wanted to make it a little bit more automated for end users, you could add this to the manifest (and probably the java csv jar as well), then change the directions to "java -classpath jdbcdriver.jar -jar jisql.jar"


[Email]
stdunbar

Newbie
[Avatar]

Joined: 06/22/2005 14:51:37
Messages: 703
Location: Superior, CO, USA
Online

Excellent idea - I don't know why I didn't do that in the first place. Look for 2.0.2 later today.

Thanks for using the forums at hotjoe.com
[WWW] [Yahoo!] [ICQ]
mkienenb

Newbie

Joined: 01/25/2010 13:51:47
Messages: 7
Offline

Well, I gave it a try with this patch



but maybe this won't work due to the driver classpath.

java -jar /home/mkienenb/java/jisql_2/lib/jisql.jar -classpath .../ojdbc14_g.jar -user cis -password cis -driver oracle.jdbc.driver.OracleDriver -cstring jdbc:oracle:thin:@...
Password (hit enter for no password):
Cannot find the driver class "oracle.jdbc.driver.OracleDriver" in the current classpath.


However, it no longer requires specifying the jopt-simple-3.2 jar when I change the manifest and use "java -classpath driver.jar:jisql.jar com.xigole.util.sql.Jisql"

This message was edited 1 time. Last update was at 01/25/2010 14:40:07

[Email]
mkienenb

Newbie

Joined: 01/25/2010 13:51:47
Messages: 7
Offline

One more bug report:

"-password value" doesn't work anymore.

You are still prompted for a password under 2.0.1 even after specifying it.
[Email]
mkienenb

Newbie

Joined: 01/25/2010 13:51:47
Messages: 7
Offline

java -Xbootclasspath/a:/pathtodriverjar/ojdbc14_g.jar -jar /pathtojisql2/lib/jisql.jar -user ... -password ... -driver oracle.jdbc.driver.OracleDriver -cstring jdbc:oracle:thin:@...

Well, it's Sun-specific, but it does work to use the -Xbootclasspath/a for the driver and combine it with -jar

It's an alternative
[Email]
 
Forum Index » Jisql
Go to:   
Powered by JForum 2.1.8 © JForum Team
This site built by Scott Dunbar of Xigole Systems. © 2005-2010 - Scott Dunbar
Java and the Java Get Powered logo are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.
hotjoe.com and xigole.com have no affiliation with Sun Microsystems, Inc.