Revision 9835 trunk/libraries/libGDBMS/src/main/java/com/hardcode/gdbms/driver/mysql/MySQLDriver.java
MySQLDriver.java | ||
---|---|---|
8 | 8 |
import java.sql.ResultSetMetaData; |
9 | 9 |
import java.sql.SQLException; |
10 | 10 |
|
11 |
import com.hardcode.gdbms.engine.data.DataSourceFactory; |
|
12 |
import com.hardcode.gdbms.engine.data.db.DBDataSourceAdapter; |
|
13 |
import com.hardcode.gdbms.engine.data.db.DBDataSourceFactory; |
|
14 |
import com.hardcode.gdbms.engine.data.db.DBDataWare; |
|
15 |
import com.hardcode.gdbms.engine.data.db.DBTableSourceInfo; |
|
11 | 16 |
import com.hardcode.gdbms.engine.data.db.JDBCSupport; |
12 | 17 |
import com.hardcode.gdbms.engine.data.driver.AbstractJDBCDriver; |
18 |
import com.hardcode.gdbms.engine.data.driver.DBDriver; |
|
19 |
import com.hardcode.gdbms.engine.data.driver.DBTransactionalDriver; |
|
20 |
import com.hardcode.gdbms.engine.data.driver.GDBMSDriver; |
|
13 | 21 |
import com.iver.cit.gvsig.fmap.drivers.DBLayerDefinition; |
14 | 22 |
import com.iver.cit.gvsig.fmap.drivers.ITableDefinition; |
15 |
import com.iver.cit.gvsig.fmap.drivers.TableDefinition; |
|
16 | 23 |
import com.iver.cit.gvsig.fmap.edition.IWriter; |
17 | 24 |
|
18 | 25 |
|
... | ... | |
22 | 29 |
* @author Fernando Gonz?lez Cort?s |
23 | 30 |
* @author azabala |
24 | 31 |
*/ |
25 |
public class MySQLDriver extends AbstractJDBCDriver { |
|
32 |
public class MySQLDriver extends AbstractJDBCDriver implements DBTransactionalDriver {
|
|
26 | 33 |
private static Exception driverException; |
27 | 34 |
|
28 | 35 |
static { |
... | ... | |
49 | 56 |
writer.initialize(con); |
50 | 57 |
writer.setCreateTable(false); |
51 | 58 |
writer.setWriteAll(false); |
59 |
DBDataWare dw = DBDataSourceFactory.newDataWareInstance(this, DataSourceFactory.DATA_WARE_DIRECT_MODE); |
|
60 |
dw.setDriver(this); |
|
61 |
ITableDefinition schema = super.getTableDefinition(); |
|
62 |
ResultSetMetaData metadata = jdbcSupport.getResultSet(). |
|
63 |
getMetaData(); |
|
64 |
|
|
65 |
DBTableSourceInfo sourceInfo = new DBTableSourceInfo(); |
|
66 |
|
|
67 |
sourceInfo.connection = con; |
|
68 |
sourceInfo.dbName = con.getCatalog(); |
|
69 |
sourceInfo.tableName = metadata.getTableName(1); |
|
70 |
|
|
71 |
dw.setSourceInfo(sourceInfo); |
|
72 |
|
|
73 |
writer.setDirectDataWare(dw); |
|
74 |
|
|
52 | 75 |
} |
53 | 76 |
|
54 | 77 |
public void close() throws SQLException { |
... | ... | |
125 | 148 |
|
126 | 149 |
} |
127 | 150 |
|
151 |
public void beginTrans(Connection con) throws SQLException { |
|
152 |
// TODO Auto-generated method stub |
|
153 |
|
|
154 |
} |
|
155 |
|
|
156 |
public void commitTrans(Connection con) throws SQLException { |
|
157 |
// TODO Auto-generated method stub |
|
158 |
|
|
159 |
} |
|
160 |
|
|
161 |
public void rollBackTrans(Connection con) throws SQLException { |
|
162 |
// TODO Auto-generated method stub |
|
163 |
|
|
164 |
} |
|
165 |
|
|
128 | 166 |
} |
Also available in: Unified diff