svn-gvsig-desktop / trunk / libraries / libGDBMS / src / com / hardcode / gdbms / engine / data / driver / DBDriver.java @ 1956
History | View | Annotate | Download (2.31 KB)
1 |
package com.hardcode.gdbms.engine.data.driver; |
---|---|
2 |
|
3 |
import com.hardcode.driverManager.Driver; |
4 |
|
5 |
import com.hardcode.gdbms.engine.data.HasProperties; |
6 |
|
7 |
import java.sql.Connection; |
8 |
import java.sql.SQLException; |
9 |
|
10 |
|
11 |
/**
|
12 |
* Interfaz a implementar por los drivers que proporcionen interfaz JDBC
|
13 |
*
|
14 |
* @author Fernando Gonz?lez Cort?s
|
15 |
*/
|
16 |
public interface DBDriver extends ReadAccess, Driver { |
17 |
/**
|
18 |
* M?todo mediante el cual el driver surte de conexiones a la base de
|
19 |
* datos.
|
20 |
*
|
21 |
* @param host nombre o direcci?n IP del host al que se quiere conectar
|
22 |
* @param port puerto al que se quiere conectar. -1 si es el puerto por
|
23 |
* defecto
|
24 |
* @param dbName Nombre de la base de datos a la que se quiere conectar
|
25 |
* @param user Usuario de la conexi?n
|
26 |
* @param password Password del usuario
|
27 |
*
|
28 |
* @return Connection
|
29 |
*
|
30 |
* @throws SQLException Si se produce alg?n error
|
31 |
*/
|
32 |
Connection getConnection(String host, int port, String dbName, String user, |
33 |
String password) throws SQLException; |
34 |
|
35 |
/**
|
36 |
* Ejecuta la instruccion que se pasa como par?metro en el gestor de base
|
37 |
* de datos en el que est? conectado el driver. Los nombres de las tablas
|
38 |
* de la instrucci?n est?n preparados para el sistema de gesti?n donde se
|
39 |
* ejecutar? la instrucci?n
|
40 |
*
|
41 |
* @param con Conexi?n con la cual se ha de obtener el ResultSet
|
42 |
* @param sql Instrucci?n SQL a ejecutar
|
43 |
* @param props Properties of the overlaying DataSource layer
|
44 |
*
|
45 |
* @throws SQLException Si se produce un error ejecutando la instrucci?n
|
46 |
* SQL public void openTable(Connection con, String table,
|
47 |
* HasProperties props) throws SQLException;
|
48 |
*/
|
49 |
public void open(Connection con, String sql, HasProperties props) |
50 |
throws SQLException; |
51 |
|
52 |
/**
|
53 |
* Executes an instruction against the server
|
54 |
*
|
55 |
* @param con Connection used to execute the instruction
|
56 |
* @param sql Instruction to execute
|
57 |
* @param props Properties of the overlaying DataSource layer
|
58 |
*
|
59 |
* @throws SQLException If the execution fails
|
60 |
*/
|
61 |
public void execute(Connection con, String sql, HasProperties props) |
62 |
throws SQLException; |
63 |
|
64 |
/**
|
65 |
* DOCUMENT ME!
|
66 |
*
|
67 |
* @throws SQLException DOCUMENT ME!
|
68 |
*/
|
69 |
public void close() throws SQLException; |
70 |
} |