runtime exceptions

130 views
Skip to first unread message

gmseed

unread,
May 11, 2013, 10:44:07 AM5/11/13
to xer...@googlegroups.com
Hi

I have the following code:

...
            rs   = stmt.executeQuery(selectQuery);
            boolean isClosed = rs.isClosed();
...

and using both sqlite-jdbc-3.7.6.3-20110609.081603-3.jar and sqlite-jdbc-3.7.15-SNAPSHOT-2.jar get the following exception thrown at the call to ResultSet.isClosed():

Exception in thread "main" java.lang.AbstractMethodError: org.sqlite.RS.isClosed()Z
at hedgehog_samples.database.SQLiteDatabase_StoringBytesSample.main(SQLiteDatabase_StoringBytesSample.java:91)


With sqlite-jdbc-3.7.15-SNAPSHOT-2.jar I get the following exception thrown for the call to isNativeMode():

            DatabaseMetaData meta = db_con.getMetaData();
            System.out.println("is-native: " + db.isNativeMode());

Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
Unhandled exception type Exception

at com.hedgehog.database.SQLiteDatabase.isNativeMode(SQLiteDatabase.java:276)

but the call to isNativeMode() is ok for sqlite-jdbc-3.7.6.3-20110609.081603-3.jar.

Graham


Grace B

unread,
May 12, 2013, 9:01:28 AM5/12/13
to xer...@googlegroups.com
Hey Graham,

What OS and JVM are you using?

gmseed

unread,
May 12, 2013, 10:35:05 AM5/12/13
to xer...@googlegroups.com
Hi

Win7-64bit and the latest jdk 1.7-u21 and the associated jre.

Graham

Grace Batumbya

unread,
May 12, 2013, 2:53:12 PM5/12/13
to xer...@googlegroups.com
The call to rs.isClosed() fails because this driver is compiled on Java 5 which does have this method.

With regards to 
With sqlite-jdbc-3.7.15-SNAPSHOT-2.jar I get the following exception thrown for the call to isNativeMode():
            DatabaseMetaData meta = db_con.getMetaData();
            System.out.println("is-native: " + db.isNativeMode());

What is the class for the variable "db".


Graham

--
You received this message because you are subscribed to a topic in the Google Groups "Xerial" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xerial/TQSei3NfG28/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to xerial+un...@googlegroups.com.
To post to this group, send email to xer...@googlegroups.com.
Visit this group at http://groups.google.com/group/xerial?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



Peter Borissow

unread,
May 13, 2013, 7:56:44 AM5/13/13
to xer...@googlegroups.com
Hi Grace-
    I understand that 1.5 didn't have the isClosed() method but does that really preclude us from implementing the isClosed() method?

Thanks,
Peter


From: Grace Batumbya <grace.b...@gmail.com>
To: xer...@googlegroups.com
Sent: Sunday, May 12, 2013 2:53 PM
Subject: Re: [xerial 705] Re: runtime exceptions

gmseed

unread,
May 13, 2013, 8:34:12 AM5/13/13
to xer...@googlegroups.com
Hi

My object "db" is an instance of a convenience class and my method isNativeMethod() simply passes on the call to SQLiteJDBCLoader:

    public boolean isNativeMode() throws Exception
    {
        boolean isNative = SQLiteJDBCLoader.isNativeMode();
        return isNative;
    }

I just reran this and it now works fine, so not sure what was happening the other day.

If isClosed() is limited to Java 5 and less then how about something along the lines:

public boolean isClosed() throws SQLException {
boolean closed = false;
if (System.getProperty("java.version").startsWith("1.5.")) {
...
} else{
  throw new SQLException("Method isClosed() is only supported up to and including Java 5.");
}
return closed;
}

Graham

Grace B

unread,
May 13, 2013, 9:15:25 AM5/13/13
to xer...@googlegroups.com
Graham,
I mean to say that Java 1.5 doesn't have ResultSet.isClose()

Peter,
Rather than going off and making one off changes like this, I would just prefer build the driver on Java 6.

gmseed

unread,
May 13, 2013, 9:19:49 AM5/13/13
to xer...@googlegroups.com
Hi

OK - I understand. Maybe makes the downloads section a bit more tricky having 5, 6, 7, 8, ... versions than a single .jar as at present. I'd personally present a single download to users.

Graham

Peter Borissow

unread,
May 13, 2013, 9:59:12 AM5/13/13
to xer...@googlegroups.com
Agreed. 1 download is preferable. I also prefer sticking to a 1.5 build if we can for maximum compatibility.

Grace, why do you think implementing isClosed() depends on >1.5 JDK? Does your compiler complain if you add extra public members to the ResultSet class? I'm not going to push hard for this feature. Just curious...

Thanks,
Peter





From: gmseed <gms...@gmail.com>
To: xer...@googlegroups.com
Sent: Monday, May 13, 2013 9:19 AM
Subject: Re: [xerial 710] Re: runtime exceptions

Hi

OK - I understand. Maybe makes the downloads section a bit more tricky having 5, 6, 7, 8, ... versions than a single .jar as at present. I'd personally present a single download to users.

Graham

On Monday, May 13, 2013 2:15:25 PM UTC+1, Grace B wrote:
Graham,
I mean to say that Java 1.5 doesn't have ResultSet.isClose()

Peter,
Rather than going off and making one off changes like this, I would just prefer build the driver on Java 6.



On Monday, May 13, 2013 8:34:12 AM UTC-4, gmseed wrote:
Hi

My object "db" is an instance of a convenience class and my method isNativeMethod() simply passes on the call to SQLiteJDBCLoader:

    public boolean isNativeMode() throws Exception
    {
        boolean isNative = SQLiteJDBCLoader.isNativeMode( );
        return isNative;
    }

I just reran this and it now works fine, so not sure what was happening the other day.

If isClosed() is limited to Java 5 and less then how about something along the lines:

public boolean isClosed() throws SQLException {
boolean closed = false;
if (System.getProperty("java. version").startsWith("1.5.")) {

...
} else{
  throw new SQLException("Method isClosed() is only supported up to and including Java 5.");
}
return closed;
}

Graham

On Sunday, May 12, 2013 7:53:12 PM UTC+1, Grace B wrote:
The call to rs.isClosed() fails because this driver is compiled on Java 5 which does have this method.

With regards to 
With sqlite-jdbc-3.7.15-SNAPSHOT-2. jar I get the following exception thrown for the call to isNativeMode():

            DatabaseMetaData meta = db_con.getMetaData();
            System.out.println("is-native: " + db.isNativeMode());

What is the class for the variable "db".

On Sun, May 12, 2013 at 10:35 AM, gmseed <gms...@gmail.com> wrote:
Hi

Win7-64bit and the latest jdk 1.7-u21 and the associated jre.

Graham

--
You received this message because you are subscribed to a topic in the Google Groups "Xerial" group.
To unsubscribe from this topic, visit https://groups.google.com/d/ topic/xerial/TQSei3NfG28/ unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to xerial+un...@googlegroups.com.
To post to this group, send email to xer...@googlegroups.com.
Visit this group at http://groups.google.com/ group/xerial?hl=en.
For more options, visit https://groups.google.com/ groups/opt_out.



--
You received this message because you are subscribed to the Google Groups "Xerial" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xerial+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages