svn-gvsig-desktop / tags / v1_1_Build_1015 / libraries / libGDBMS / src / main / java / com / hardcode / gdbms / engine / data / driver / DBDriver.java @ 13679
History | View | Annotate | Download (1.89 KB)
1 | 3199 | fjp | package com.hardcode.gdbms.engine.data.driver; |
---|---|---|---|
2 | |||
3 | import java.sql.Connection; |
||
4 | import java.sql.SQLException; |
||
5 | |||
6 | import com.hardcode.driverManager.Driver; |
||
7 | import com.hardcode.gdbms.engine.values.ValueWriter; |
||
8 | |||
9 | |||
10 | /**
|
||
11 | * Interfaz a implementar por los drivers que proporcionen interfaz JDBC
|
||
12 | *
|
||
13 | * @author Fernando Gonz?lez Cort?s
|
||
14 | */
|
||
15 | public interface DBDriver extends ReadAccess, GDBMSDriver, ValueWriter { |
||
16 | /**
|
||
17 | * M?todo mediante el cual el driver surte de conexiones a la base de
|
||
18 | * datos.
|
||
19 | *
|
||
20 | * @param host nombre o direcci?n IP del host al que se quiere conectar
|
||
21 | * @param port puerto al que se quiere conectar. -1 si es el puerto por
|
||
22 | * defecto
|
||
23 | * @param dbName Nombre de la base de datos a la que se quiere conectar
|
||
24 | * @param user Usuario de la conexi?n
|
||
25 | * @param password Password del usuario
|
||
26 | *
|
||
27 | * @return Connection
|
||
28 | *
|
||
29 | * @throws SQLException Si se produce alg?n error
|
||
30 | */
|
||
31 | Connection getConnection(String host, int port, String dbName, String user, |
||
32 | String password) throws SQLException; |
||
33 | |||
34 | /**
|
||
35 | * Executes an instruction against the server
|
||
36 | *
|
||
37 | * @param con Connection used to execute the instruction
|
||
38 | * @param sql Instruction to execute
|
||
39 | * @param props Properties of the overlaying DataSource layer
|
||
40 | *
|
||
41 | * @throws SQLException If the execution fails
|
||
42 | */
|
||
43 | public void execute(Connection con, String sql) |
||
44 | throws SQLException; |
||
45 | |||
46 | /**
|
||
47 | * Free any resource reserved in the open method
|
||
48 | *
|
||
49 | * @throws SQLException If the free fails
|
||
50 | */
|
||
51 | public void close() throws SQLException; |
||
52 | |||
53 | /**
|
||
54 | * Gets the name of the table as it's stored on the system tables. The
|
||
55 | * result of this method is used in calls to methods as
|
||
56 | * DatabaseMetadata.getPrimaryKeys
|
||
57 | *
|
||
58 | * @param tablename table name
|
||
59 | *
|
||
60 | * @return String
|
||
61 | */
|
||
62 | public String getInternalTableName(String tablename); |
||
63 | } |