Statistics
| Revision:

root / trunk / libraries / libDataSourceDBBaseDrivers / src / org / gvsig / data / datastores / vectorial / driver / jdbc / h2 / H2DataSource.java @ 19610

History | View | Annotate | Download (1.61 KB)

1
package org.gvsig.data.datastores.vectorial.driver.jdbc.h2;
2

    
3
import java.sql.Connection;
4
import java.sql.DriverManager;
5
import java.sql.SQLException;
6

    
7
import org.gvsig.data.IDataSourceParameters;
8
import org.gvsig.data.IDataStoreParameters;
9
import org.gvsig.data.datastores.vectorial.driver.dbf.DBFDataSourceParameters;
10
import org.gvsig.data.datastores.vectorial.driver.jdbc.AbstractDataSourceDBDriverJDBC;
11
import org.gvsig.data.datastores.vectorial.driver.jdbc.exception.JDBCDriverNotFoundException;
12
import org.gvsig.data.exception.InitializeException;
13
import org.gvsig.data.exception.ReadException;
14

    
15
public class H2DataSource extends AbstractDataSourceDBDriverJDBC {
16
        public static String DATASOURCE_NAME="H2DataSource";
17

    
18
        private Connection connection;
19

    
20
        public String getName() {
21
                // TODO Auto-generated method stub
22
                return null;
23
        }
24

    
25
        public IDataStoreParameters[] getSources() throws ReadException {
26
                // TODO Auto-generated method stub
27
                return null;
28
        }
29

    
30
        public void init(IDataSourceParameters parameters) {
31
                // TODO Auto-generated method stub
32

    
33
        }
34

    
35
        Connection getConnection(){
36
                // FIXME: OJO REsource manager
37
                return this.connection;
38

    
39
        }
40

    
41

    
42

    
43
        private void initConnection() throws ReadException{
44
//                String dburl = this.getParameters().getUrl();
45
//                String dbuser = this.getParameters().getUser();
46
//                String dbpass = this.getParameters().getPassw();
47

    
48

    
49
                //TODO: Aqu? habria que implementar la llamada
50
                //      al Resource Manager para comprobar si ya hay
51
                //                una connexion a la BD
52

    
53
                Connection conn = null;
54

    
55
//                conn = H2DriverUtils.getConnection(dburl, dbuser, dbpass);
56

    
57

    
58
                this.connection = conn;
59

    
60
//                conn.getMetaData().
61
        }
62

    
63

    
64
}