diff options
Diffstat (limited to 'src/java/com')
-rw-r--r-- | src/java/com/healthmarketscience/jackcess/Database.java | 15 | ||||
-rw-r--r-- | src/java/com/healthmarketscience/jackcess/JetFormat.java | 7 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/java/com/healthmarketscience/jackcess/Database.java b/src/java/com/healthmarketscience/jackcess/Database.java index 5915d2c..9fd6b3b 100644 --- a/src/java/com/healthmarketscience/jackcess/Database.java +++ b/src/java/com/healthmarketscience/jackcess/Database.java @@ -398,6 +398,8 @@ public class Database private Charset _charset; /** timezone to use when handling dates */ private TimeZone _timeZone; + /** language sort order to be used for textual columns */ + private Short _defaultSortOrder; /** the ordering used for table columns */ private Table.ColumnOrder _columnOrder; /** cache of in-use tables */ @@ -888,6 +890,19 @@ public class Database } /** + * @return the currently configured database default language sort order for + * textual columns + */ + public short getDefaultSortOrder() throws IOException { + + if(_defaultSortOrder == null) { + _pageChannel.readPage(_buffer, 0); + _defaultSortOrder = _buffer.getShort(_format.OFFSET_SORT_ORDER); + } + return _defaultSortOrder; + } + + /** * @return a PropertyMaps instance decoded from the given bytes (always * returns non-{@code null} result). */ diff --git a/src/java/com/healthmarketscience/jackcess/JetFormat.java b/src/java/com/healthmarketscience/jackcess/JetFormat.java index dbe3e47..f319b24 100644 --- a/src/java/com/healthmarketscience/jackcess/JetFormat.java +++ b/src/java/com/healthmarketscience/jackcess/JetFormat.java @@ -175,6 +175,7 @@ public abstract class JetFormat { public final int OFFSET_HEADER_DATE; public final int OFFSET_PASSWORD; public final int SIZE_PASSWORD; + public final int OFFSET_SORT_ORDER; public final int OFFSET_ENCODING_KEY; public final int OFFSET_NEXT_TABLE_DEF_PAGE; public final int OFFSET_NUM_ROWS; @@ -300,6 +301,7 @@ public abstract class JetFormat { OFFSET_HEADER_DATE = defineOffsetHeaderDate(); OFFSET_PASSWORD = defineOffsetPassword(); SIZE_PASSWORD = defineSizePassword(); + OFFSET_SORT_ORDER = defineOffsetSortOrder(); OFFSET_ENCODING_KEY = defineOffsetEncodingKey(); OFFSET_NEXT_TABLE_DEF_PAGE = defineOffsetNextTableDefPage(); OFFSET_NUM_ROWS = defineOffsetNumRows(); @@ -393,6 +395,7 @@ public abstract class JetFormat { protected abstract int defineOffsetHeaderDate(); protected abstract int defineOffsetPassword(); protected abstract int defineSizePassword(); + protected abstract int defineOffsetSortOrder(); protected abstract int defineOffsetEncodingKey(); protected abstract int defineOffsetNextTableDefPage(); protected abstract int defineOffsetNumRows(); @@ -520,6 +523,8 @@ public abstract class JetFormat { @Override protected int defineSizePassword() { return 20; } @Override + protected int defineOffsetSortOrder() { return 58; } + @Override protected int defineOffsetEncodingKey() { return 62; } @Override protected int defineOffsetNextTableDefPage() { return 4; } @@ -715,6 +720,8 @@ public abstract class JetFormat { @Override protected int defineSizePassword() { return 40; } @Override + protected int defineOffsetSortOrder() { return 110; } + @Override protected int defineOffsetEncodingKey() { return 62; } @Override protected int defineOffsetNextTableDefPage() { return 4; } |