Guest User

Untitled

a guest
Jun 13th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. import java.sql.*;
  2.  
  3. import SQLite.Callback;
  4. import SQLite.Database;
  5. import SQLite.JDBC2y.JDBCConnection;
  6.  
  7. public class Main {
  8.  
  9. public static void main( String[] args ) throws Exception {
  10.  
  11. Class.forName( "SQLite.JDBCDriver");
  12. Connection cx = DriverManager.getConnection("jdbc:sqlite:/foo");
  13. JDBCConnection ncx = (JDBCConnection) cx;
  14. Database db = ncx.getSQLiteDatabase();
  15.  
  16. //String s = new String( "libspatialite.so");
  17.  
  18. Callback cb = new Callback(){
  19.  
  20. public void columns(String[] arg0) {
  21. }
  22.  
  23. public boolean newrow(String[] arg0) {
  24.  
  25. return false;
  26. }
  27.  
  28. public void types(String[] arg0) {
  29. }
  30.  
  31. };
  32.  
  33. db.exec("SELECT load_extension('libspatialite.so')",cb);
  34. db.exec("SELECT InitSpatialMetaData()",cb);
  35. }
  36.  
  37. }
Add Comment
Please, Sign In to add comment