Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.*;
- import SQLite.Callback;
- import SQLite.Database;
- import SQLite.JDBC2y.JDBCConnection;
- public class Main {
- public static void main( String[] args ) throws Exception {
- Class.forName( "SQLite.JDBCDriver");
- Connection cx = DriverManager.getConnection("jdbc:sqlite:/foo");
- JDBCConnection ncx = (JDBCConnection) cx;
- Database db = ncx.getSQLiteDatabase();
- //String s = new String( "libspatialite.so");
- Callback cb = new Callback(){
- public void columns(String[] arg0) {
- }
- public boolean newrow(String[] arg0) {
- return false;
- }
- public void types(String[] arg0) {
- }
- };
- db.exec("SELECT load_extension('libspatialite.so')",cb);
- db.exec("SELECT InitSpatialMetaData()",cb);
- }
- }
Add Comment
Please, Sign In to add comment