OSDN Git Service

git-svn-id: http://www.xerial.org/svn/project/XerialJ/trunk/sqlite-jdbc@2993 ae02f08e...
authorleo <leo@ae02f08e-27ec-0310-ae8c-8ba02fe2eafd>
Wed, 18 Feb 2009 04:18:59 +0000 (04:18 +0000)
committerleo <leo@ae02f08e-27ec-0310-ae8c-8ba02fe2eafd>
Wed, 18 Feb 2009 04:18:59 +0000 (04:18 +0000)
pom.xml
src/test/java/org/sqlite/BackupTest.java [new file with mode: 0644]

diff --git a/pom.xml b/pom.xml
index 605e09e..2553ace 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
   <modelVersion>4.0.0</modelVersion>\r
   <groupId>org.xerial</groupId>\r
   <artifactId>sqlite-jdbc</artifactId>\r
-  <version>3.6.11</version>\r
+  <version>3.6.11.1-SNAPSHOT</version>\r
   <name>SQLite JDBC</name>\r
   <description>SQLite JDBC library</description>\r
 \r
diff --git a/src/test/java/org/sqlite/BackupTest.java b/src/test/java/org/sqlite/BackupTest.java
new file mode 100644 (file)
index 0000000..5a370be
--- /dev/null
@@ -0,0 +1,42 @@
+//--------------------------------------
+// sqlite-jdbc Project
+//
+// BackupTest.java
+// Since: Feb 18, 2009
+//
+// $URL$ 
+// $Author$
+//--------------------------------------
+package org.sqlite;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class BackupTest
+{
+    @BeforeClass
+    public static void forName() throws Exception
+    {
+        Class.forName("org.sqlite.JDBC");
+    }
+
+    @Test
+    public void openMemory() throws SQLException
+    {
+        Connection conn = DriverManager.getConnection("jdbc:sqlite:");
+        Statement stmt = conn.createStatement();
+        stmt.executeUpdate("create table sample(id, name)");
+        stmt.executeUpdate("insert into sample values(1, \"leo\")");
+        stmt.executeUpdate("insert into sample values(2, \"yui\")");
+
+        // TODO some backup mechanism 
+        // stmt.executeUpdate("backup sample.db");
+        conn.close();
+    }
+
+}