Revision 12534 branches/v10/libraries/libGDBMS/src/main/java/com/hardcode/gdbms/driver/dbf/DBFDriver.java
DBFDriver.java | ||
---|---|---|
37 | 37 |
private DbaseFile dbf = new DbaseFile(); |
38 | 38 |
private char[] fieldTypes; |
39 | 39 |
private DataSourceFactory dsf; |
40 |
|
|
41 | 40 |
|
41 |
|
|
42 | 42 |
/** |
43 | 43 |
* @see com.hardcode.driverManager.Driver#getName() |
44 | 44 |
*/ |
... | ... | |
122 | 122 |
throw new DriverException(e1); |
123 | 123 |
} |
124 | 124 |
strValue = strValue.trim(); |
125 |
if (fieldType == Types.BOOLEAN){ |
|
126 |
strValue = strValue.toLowerCase(); |
|
127 |
strValue = Boolean.toString(strValue.equals("t") || strValue.equals("y")); |
|
128 |
} |
|
129 |
|
|
125 | 130 |
try { |
126 | 131 |
return ValueFactory.createValueByType(strValue, fieldType); |
127 | 132 |
} catch (ParseException e) { |
... | ... | |
204 | 209 |
|
205 | 210 |
dbfWrite.write(record); |
206 | 211 |
} |
207 |
|
|
212 |
|
|
208 | 213 |
dbfWrite.close(); |
209 | 214 |
} catch (IOException e) { |
210 | 215 |
throw new DriverException(e); |
211 | 216 |
} |
212 |
|
|
217 |
|
|
213 | 218 |
} |
214 |
|
|
219 |
|
|
215 | 220 |
/** |
216 | 221 |
* @see com.hardcode.gdbms.engine.data.driver.FileDriver#writeFile(com.hardcode.gdbms.engine.data.file.FileDataWare, |
217 | 222 |
* java.io.File) |
218 | 223 |
*/ |
219 | 224 |
public void writeFile(FileDataWare dataWare) |
220 | 225 |
throws DriverException { |
221 |
|
|
226 |
|
|
222 | 227 |
String temp = dsf.getTempFile(); |
223 |
|
|
228 |
|
|
224 | 229 |
writeToTemp(dataWare, new File(temp)); |
225 | 230 |
|
226 | 231 |
try { |
Also available in: Unified diff