Re: [jruby-user] JRuby and Sqlite3

Ariel Valentin <[email protected]> Sat, 28 Feb 2015 10:21:45 -0500
Newsgroups gmane.comp.lang.jruby.user
Message-ID <[email protected]>
Does your jar contain all of the dependencies? Or are they located somewhere else?

Thanks,
Ariel
---
Sent from my mobile device. Please excuse any errors.

> On Feb 28, 2015, at 10:05 AM, Roderich T. <[email protected]> wrote:
> 
> Hi,
> I want to compile my ruby application into a jar File.
> 
> Now there I get a strange error using jdbc/sqlite3.
> 
> This is my ruby (test) code:
> 
> require 'rubygems'
> require 'jdbc/sqlite3'
> require 'java'
> 
> import org.sqlite.JDBC
> 
> connection = java.sql.DriverManager.getConnection
> 'jdbc:sqlite:test.sqlite3'
> begin
>  statement = connection.createStatement
>  begin
>    statement.executeUpdate("insert into user values ('test', 7)")
>    rs = statement.executeQuery("select * from user")
>    begin
>      puts "user\tpass"
>      while rs.next
>        puts ["#{rs.getString(1)}",
>              "#{rs.getString(2)}"].join("\t")
>      end
>    ensure
>      rs.close
>    end
>  ensure
>    statement.close
>  end
> ensure
>  connection.close
> end
> 
> There are no problems using jruby directly, but when I include the
> script in jruby-complete.jar using "jar ufe myapp.jar
> org.jruby.JarBootstrapMain jar-bootstrap.rb", I always get an error when
> I start it ( java -jar myapp.jar ):
> 
> NameError: missing class or uppercase package name (`org.sqlite.JDBC')
> 
> -- 
> Posted via http://www.ruby-forum.com/.
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>    http://xircles.codehaus.org/manage_email
> 
> 

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email