svn-gvsig-desktop / trunk / libraries / libGDBMS / src / com / hardcode / gdbms / engine / data / DBQueryDataSourceAdapter.java @ 466
History | View | Annotate | Download (844 Bytes)
1 |
/*
|
---|---|
2 |
* Created on 17-oct-2004
|
3 |
*/
|
4 |
package com.hardcode.gdbms.engine.data; |
5 |
|
6 |
import java.sql.SQLException; |
7 |
|
8 |
/**
|
9 |
* @author Fernando Gonz?lez Cort?s
|
10 |
*/
|
11 |
public class DBQueryDataSourceAdapter extends DBDataSourceAdapter { |
12 |
private String sql; |
13 |
|
14 |
/**
|
15 |
* @see com.hardcode.gdbms.engine.data.DataSource#start()
|
16 |
*/
|
17 |
public void start() throws DriverException { |
18 |
super.start();
|
19 |
|
20 |
try {
|
21 |
((DBDriver) getDriver()).executeSQL(sql); |
22 |
} catch (SQLException e) { |
23 |
throw new DriverException(e); |
24 |
} |
25 |
} |
26 |
|
27 |
/**
|
28 |
* Establece el nombre de la tabla
|
29 |
*
|
30 |
* @param tableName
|
31 |
*/
|
32 |
public void setSQL(String sql) { |
33 |
this.sql = sql;
|
34 |
} |
35 |
|
36 |
/**
|
37 |
* DOCUMENT ME!
|
38 |
*
|
39 |
* @return Returns the table.
|
40 |
*/
|
41 |
public String getSQL() { |
42 |
return sql;
|
43 |
} |
44 |
|
45 |
} |