summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2011-03-14 02:25:21 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2011-03-14 02:25:21 +0000
commit32a3d34bd2b74381877f905d3514708a97b91c3f (patch)
treec19bfb31ddea68514c4aa263d2c697d8357e20a9 /src
parent48e87a45641089eba1716e856505f74bd359f0e7 (diff)
downloadjackcess-32a3d34bd2b74381877f905d3514708a97b91c3f.tar.gz
jackcess-32a3d34bd2b74381877f905d3514708a97b91c3f.zip
add nominal support for access 2010, essentially read-only until the new text index sorting is worked out
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@525 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src')
-rw-r--r--src/java/com/healthmarketscience/jackcess/Column.java9
-rw-r--r--src/java/com/healthmarketscience/jackcess/Database.java3
-rw-r--r--src/java/com/healthmarketscience/jackcess/JetFormat.java57
3 files changed, 52 insertions, 17 deletions
diff --git a/src/java/com/healthmarketscience/jackcess/Column.java b/src/java/com/healthmarketscience/jackcess/Column.java
index d22b61c..f578f76 100644
--- a/src/java/com/healthmarketscience/jackcess/Column.java
+++ b/src/java/com/healthmarketscience/jackcess/Column.java
@@ -93,15 +93,18 @@ public class Column implements Comparable<Column> {
25569L * (long)MILLISECONDS_PER_DAY;
/**
- * Long value (LVAL) type that indicates that the value is stored on the same page
+ * Long value (LVAL) type that indicates that the value is stored on the
+ * same page
*/
private static final byte LONG_VALUE_TYPE_THIS_PAGE = (byte) 0x80;
/**
- * Long value (LVAL) type that indicates that the value is stored on another page
+ * Long value (LVAL) type that indicates that the value is stored on another
+ * page
*/
private static final byte LONG_VALUE_TYPE_OTHER_PAGE = (byte) 0x40;
/**
- * Long value (LVAL) type that indicates that the value is stored on multiple other pages
+ * Long value (LVAL) type that indicates that the value is stored on
+ * multiple other pages
*/
private static final byte LONG_VALUE_TYPE_OTHER_PAGES = (byte) 0x00;
diff --git a/src/java/com/healthmarketscience/jackcess/Database.java b/src/java/com/healthmarketscience/jackcess/Database.java
index 806c791..1c6e5b6 100644
--- a/src/java/com/healthmarketscience/jackcess/Database.java
+++ b/src/java/com/healthmarketscience/jackcess/Database.java
@@ -245,7 +245,8 @@ public class Database
V1997(null, JetFormat.VERSION_3),
V2000(RESOURCE_PATH + "empty.mdb", JetFormat.VERSION_4),
V2003(RESOURCE_PATH + "empty2003.mdb", JetFormat.VERSION_4),
- V2007(RESOURCE_PATH + "empty2007.accdb", JetFormat.VERSION_5, ".accdb"),
+ V2007(RESOURCE_PATH + "empty2007.accdb", JetFormat.VERSION_12, ".accdb"),
+ V2010(RESOURCE_PATH + "empty2010.accdb", JetFormat.VERSION_14, ".accdb"),
MSISAM(null, JetFormat.VERSION_MSISAM, ".mny");
private final String _emptyFile;
diff --git a/src/java/com/healthmarketscience/jackcess/JetFormat.java b/src/java/com/healthmarketscience/jackcess/JetFormat.java
index d512659..08db1e0 100644
--- a/src/java/com/healthmarketscience/jackcess/JetFormat.java
+++ b/src/java/com/healthmarketscience/jackcess/JetFormat.java
@@ -60,8 +60,10 @@ public abstract class JetFormat {
private static final byte CODE_VERSION_3 = 0x0;
/** Version code for Jet version 4 */
private static final byte CODE_VERSION_4 = 0x1;
- /** Version code for Jet version 5 */
- private static final byte CODE_VERSION_5 = 0x2;
+ /** Version code for Jet version 12 */
+ private static final byte CODE_VERSION_12 = 0x2;
+ /** Version code for Jet version 14 */
+ private static final byte CODE_VERSION_14 = 0x3;
/** location of the engine name in the header */
static final int OFFSET_ENGINE_NAME = 0x4;
@@ -116,9 +118,12 @@ public abstract class JetFormat {
private static final Map<Database.FileFormat,byte[]> POSSIBLE_VERSION_4 =
new EnumMap<Database.FileFormat,byte[]>(Database.FileFormat.class);
- private static final Map<Database.FileFormat,byte[]> POSSIBLE_VERSION_5 =
+ private static final Map<Database.FileFormat,byte[]> POSSIBLE_VERSION_12 =
Collections.singletonMap(Database.FileFormat.V2007, (byte[])null);
+ private static final Map<Database.FileFormat,byte[]> POSSIBLE_VERSION_14 =
+ Collections.singletonMap(Database.FileFormat.V2010, (byte[])null);
+
private static final Map<Database.FileFormat,byte[]> POSSIBLE_VERSION_MSISAM =
Collections.singletonMap(Database.FileFormat.MSISAM, (byte[])null);
@@ -134,8 +139,10 @@ public abstract class JetFormat {
public static final JetFormat VERSION_4 = new Jet4Format();
/** the JetFormat constants for the MSISAM database */
public static final JetFormat VERSION_MSISAM = new MSISAMFormat();
- /** the JetFormat constants for the Jet database version "5" */
- public static final JetFormat VERSION_5 = new Jet5Format();
+ /** the JetFormat constants for the Jet database version "12" */
+ public static final JetFormat VERSION_12 = new Jet12Format();
+ /** the JetFormat constants for the Jet database version "14" */
+ public static final JetFormat VERSION_14 = new Jet14Format();
//These constants are populated by this class's constructor. They can't be
//populated by the subclass's constructor because they are final, and Java
@@ -262,8 +269,10 @@ public abstract class JetFormat {
return VERSION_MSISAM;
}
return VERSION_4;
- } else if (version == CODE_VERSION_5) {
- return VERSION_5;
+ } else if (version == CODE_VERSION_12) {
+ return VERSION_12;
+ } else if (version == CODE_VERSION_14) {
+ return VERSION_14;
}
throw new IOException("Unsupported " +
((version < CODE_VERSION_3) ? "older" : "newer") +
@@ -664,7 +673,7 @@ public abstract class JetFormat {
this("VERSION_4");
}
- private Jet4Format(final String name) {
+ private Jet4Format(String name) {
super(name);
}
@@ -870,17 +879,39 @@ public abstract class JetFormat {
}
}
- private static final class Jet5Format extends Jet4Format {
- private Jet5Format() {
- super("VERSION_5");
- }
+ private static class Jet12Format extends Jet4Format {
+ private Jet12Format() {
+ super("VERSION_12");
+ }
+
+
+ private Jet12Format(String name) {
+ super(name);
+ }
@Override
protected boolean defineReverseFirstByteInDescNumericIndexes() { return true; }
@Override
protected Map<Database.FileFormat,byte[]> getPossibleFileFormats() {
- return PossibleFileFormats.POSSIBLE_VERSION_5;
+ return PossibleFileFormats.POSSIBLE_VERSION_12;
+ }
+ }
+
+ private static final class Jet14Format extends Jet12Format {
+ private Jet14Format() {
+ super("VERSION_14");
+ }
+
+ @Override
+ protected boolean defineIndexesSupported() {
+ // 2010 uses a new text index format (new "General" sort order)...
+ return false;
+ }
+
+ @Override
+ protected Map<Database.FileFormat,byte[]> getPossibleFileFormats() {
+ return PossibleFileFormats.POSSIBLE_VERSION_14;
}
}