git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@94 f203690c-595d-4dc9-a70b-905162fa7fd2tags/rel_1_1_6
public void createTable(String name, List<Column> columns) | public void createTable(String name, List<Column> columns) | ||||
throws IOException | throws IOException | ||||
{ | { | ||||
if(getTable(name) != null) { | if(getTable(name) != null) { | ||||
throw new IllegalArgumentException( | throw new IllegalArgumentException( | ||||
"Cannot create table with name of existing table"); | "Cannot create table with name of existing table"); | ||||
} | } | ||||
//There is some really bizarre bug in here where tables that start with | |||||
//the letters a-m (only lower case) won't open in Access. :) | |||||
name = Character.toUpperCase(name.charAt(0)) + name.substring(1); | |||||
//We are creating a new page at the end of the db for the tdef. | //We are creating a new page at the end of the db for the tdef. | ||||
int pageNumber = _pageChannel.getPageCount(); | int pageNumber = _pageChannel.getPageCount(); | ||||
public EntryColumn(Column col, Comparable value) { | public EntryColumn(Column col, Comparable value) { | ||||
_column = col; | _column = col; | ||||
_value = value; | _value = value; | ||||
if(_column.getType() == DataType.TEXT) { | |||||
// index strings are stored as uppercase | |||||
_value = ((_value != null) ? _value.toString().toUpperCase() : null); | |||||
} | |||||
} | } | ||||
/** | /** | ||||
if (_column.getType() == DataType.TEXT) { | if (_column.getType() == DataType.TEXT) { | ||||
String s = (String) _value; | String s = (String) _value; | ||||
for (int i = 0; i < s.length(); i++) { | for (int i = 0; i < s.length(); i++) { | ||||
Byte b = (Byte) CODES.get(new Character(Character.toUpperCase(s.charAt(i)))); | |||||
Byte b = (Byte) CODES.get(new Character(s.charAt(i))); | |||||
if (b == null) { | if (b == null) { | ||||
throw new IOException("Unmapped index value: " + s.charAt(i)); | throw new IOException("Unmapped index value: " + s.charAt(i)); |