Revision 10627 trunk/libraries/libGDBMS/src/main/java/com/hardcode/gdbms/driver/foodriver/FooDriver.java
FooDriver.java | ||
---|---|---|
7 | 7 |
import java.sql.Timestamp; |
8 | 8 |
import java.util.HashMap; |
9 | 9 |
|
10 |
import com.hardcode.gdbms.driver.exceptions.BadFieldDriverException; |
|
11 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
|
10 | 12 |
import com.hardcode.gdbms.engine.data.DataSourceFactory; |
11 | 13 |
import com.hardcode.gdbms.engine.data.driver.AlphanumericDBDriver; |
12 |
import com.hardcode.gdbms.engine.data.driver.DriverException; |
|
13 | 14 |
import com.hardcode.gdbms.engine.spatial.GeneralPath; |
14 | 15 |
import com.hardcode.gdbms.engine.spatial.GeometryImpl; |
15 | 16 |
import com.hardcode.gdbms.engine.spatial.PTTypes; |
... | ... | |
28 | 29 |
public void execute(Connection con, String sql) throws SQLException { |
29 | 30 |
} |
30 | 31 |
|
31 |
public void close() throws SQLException {
|
|
32 |
public void close() throws SQLException { |
|
32 | 33 |
} |
33 | 34 |
|
34 | 35 |
public String getInternalTableName(String tablename) { |
35 | 36 |
return tablename; |
36 | 37 |
} |
37 | 38 |
|
38 |
public Value getFieldValue(long rowIndex, int fieldId) throws DriverException { |
|
39 |
public Value getFieldValue(long rowIndex, int fieldId) throws ReadDriverException {
|
|
39 | 40 |
GeneralPath gp = new GeneralPath(); |
40 | 41 |
gp.moveTo(10.0, 10.0); |
41 | 42 |
gp.lineTo(10.0, 20.0); |
... | ... | |
46 | 47 |
return v; |
47 | 48 |
} |
48 | 49 |
|
49 |
public int getFieldCount() throws DriverException { |
|
50 |
public int getFieldCount() throws ReadDriverException {
|
|
50 | 51 |
return 1; |
51 | 52 |
} |
52 | 53 |
|
53 |
public String getFieldName(int fieldId) throws DriverException { |
|
54 |
if (fieldId != 1) throw new DriverException("El campo no existe");
|
|
54 |
public String getFieldName(int fieldId) throws ReadDriverException {
|
|
55 |
if (fieldId != 1) throw new BadFieldDriverException(getName(),null,String.valueOf(fieldId));
|
|
55 | 56 |
return "Geometr?a"; |
56 | 57 |
} |
57 | 58 |
|
58 |
public long getRowCount() throws DriverException { |
|
59 |
public long getRowCount() throws ReadDriverException {
|
|
59 | 60 |
return 1; |
60 | 61 |
} |
61 | 62 |
|
62 |
public int getFieldType(int i) throws DriverException { |
|
63 |
if (i != 1) throw new DriverException("El campo no existe");
|
|
63 |
public int getFieldType(int i) throws ReadDriverException {
|
|
64 |
if (i != 1) throw new BadFieldDriverException(getName(),null,String.valueOf(i));
|
|
64 | 65 |
return PTTypes.GEOMETRY; |
65 | 66 |
} |
66 | 67 |
|
... | ... | |
113 | 114 |
} |
114 | 115 |
|
115 | 116 |
public void setDataSourceFactory(DataSourceFactory dsf) { |
116 |
|
|
117 |
|
|
117 | 118 |
} |
118 | 119 |
|
119 |
public int getFieldWidth(int i) throws DriverException { |
|
120 |
if (i != 1) throw new DriverException("El campo no existe");
|
|
120 |
public int getFieldWidth(int i) throws ReadDriverException {
|
|
121 |
if (i != 1) throw new BadFieldDriverException(getName(),null,String.valueOf(i));
|
|
121 | 122 |
return 1; |
122 | 123 |
} |
123 | 124 |
|
124 |
public ITableDefinition getTableDefinition() { |
|
125 |
public ITableDefinition getTableDefinition() throws ReadDriverException {
|
|
125 | 126 |
return null; |
126 | 127 |
} |
127 | 128 |
|
Also available in: Unified diff