On Sep 23, 8:09 am, satterlee <[EMAIL PROTECTED]> wrote:
> I am using H2 for a project I am working on and I have been asked to
> show which version of JDBC is supported. I cannot seem to find a
> definitive answer in the docs. Is there an API call or something to
> get this, or a doc that I point people to for reference?
>
This should help:
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;
public class Main {
public static void main(String[] args) throws Exception {
Class.forName("org.h2.Driver");
Connection conn = DriverManager.getConnection("jdbc:h2:~/test");
DatabaseMetaData meta = conn.getMetaData();
System.out.println(meta.getJDBCMajorVersion() + "." +
meta.getJDBCMinorVersion());
conn.close();
}
}
On my machine it printed "3.0" (H2 version 1.0.78).
--
Best regards,
Pawel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en
-~----------~----~----~----~------~----~------~--~---