From: Taufik Chowi <m4g1c14n2000@yahoo.com>
To: java@gcc.gnu.org
Subject: GCJ Compile HSQLDB Problem.
Date: Wed, 10 Sep 2008 11:12:00 -0000 [thread overview]
Message-ID: <498354.13068.qm@web54603.mail.re2.yahoo.com> (raw)
Test_HSQLDB.java
import java.sql.*;
public class Test_HSQLDB {
public static void main(String[] args) throws Exception {
Class.forName("org.hsqldb.jdbcDriver");
Connection conn = DriverManager.getConnection("jdbc:hsqldb:test.db");
Statement stat = conn.createStatement();
stat.executeUpdate("drop table if exists people;");
stat.executeUpdate("create table people (id INTEGER IDENTITY , name VARCHAR(256), occupation VARCHAR(256));");
PreparedStatement prep = conn.prepareStatement("insert into people (name, occupation) values (?, ?);");
prep.setString(1, "Gandhi");
prep.setString(2, "politics");
prep.addBatch();
prep.setString(1, "Turing");
prep.setString(2, "computers");
prep.addBatch();
prep.setString(1, "Wittgenstein");
prep.setString(2, "smartypants");
prep.addBatch();
conn.setAutoCommit(false);
prep.executeBatch();
conn.setAutoCommit(true);
ResultSet rs = stat.executeQuery("select * from people;");
while (rs.next()) {
System.out.println("name = " + rs.getString("name"));
System.out.println("job = " + rs.getString("occupation"));
}
rs.close();
stat.execute("SHUTDOWN");
conn.close();
}
}
to run this well in with java, you have to download HSQLDB 1.7.2.11 http://downloads.sourceforge.net/hsqldb/hsqldb_1_7_2_11.zip?modtime=1103945242&big_mirror=0
if you have downloaded the file, you need to extract them, and at lib folders, you can find servlet.jar and hsqldb.jar , put it in your jre/lib/ext folder
the code above run with no problem with JVM and Excelsior JET
but it has so many runtime problem with gcj, and yes i know this is because i am very new with gcj so yeah i will be learning a lot from this mailing list =))
here is what i type to compile this code using gcj , if i am wrong please let me know (just in case if i have made any syntax error)
(I put servlet.jar , hsqldb.jar and Test_HSQLDB.java in gcc-4.3\bin folder , because i dont know any better way xD , please englighten me if there are any better way of doing this)
D:\gcc-4.3\bin>gcj -fjni -O2 -c servlet.jar hsqldb.jar Test_HSQLDB.java -o Test_HSQLDB.o
D:\gcc-4.3\bin>gcj --main=Test_HSQLDB -o Test_HSQLDB Test_HSQLDB.o
it generate a file named Test_HSQLDB.exe , and no error
BUT
runtime error occured when we run Test_HSQLDB.exe
Exception in thread "main" java.sql.SQLException: Software module not installed
at org.hsqldb.jdbc.jdbcUtil.sqlException(C:/DOCUME~1/userr/LOCALS~1/Temp/cc2Naaaa.i:0)
at org.hsqldb.jdbc.jdbcConnection.<init>(C:/DOCUME~1/userr/LOCALS~1/Temp/cc2Naaaa.i:0)
at org.hsqldb.jdbcDriver.getConnection(C:/DOCUME~1/userr/LOCALS~1/Temp/cc2Naaaa.i:0)
at java.sql.DriverManager.getConnection(/datal/gcc/gcc/libjava/classpath/java/sql/DriverManager.java:166)
at java.sql.DriverManager.getConnection(/datal/gcc/gcc/libjava/classpath/java/sql/DriverManager.java:205)
at Test_HSQLDB.main(C:/DOCUME~1/userr/LOCALS~1/Temp/cc2Naaaa.i:0)
i have tried googling "Software Module Not Installed" , or "HSQLDB GCJ" , but i didnt find any good answer
i know i have done some silly mistake , perhaps somewhere around the command i used for compiling... but i dont know what T.T (and i dont have enough money to implement my project using JET Excelsior) T.T
oh btw, this is my first post , please be nice xD
Thanks a lot
Cheers and God Bless,
Chowi
next reply other threads:[~2008-09-10 11:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-10 11:12 Taufik Chowi [this message]
2008-09-11 12:25 ` Andrew Haley
2008-09-12 3:21 Taufik Chowi
[not found] <431007.91848.qm@web54602.mail.re2.yahoo.com>
2008-09-12 10:03 ` Andrew Haley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=498354.13068.qm@web54603.mail.re2.yahoo.com \
--to=m4g1c14n2000@yahoo.com \
--cc=java@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).