Revision 4436

View differences:

trunk/libraries/libGDBMS/src/main/java/com/hardcode/gdbms/driver/hsqldb/HSQLDBDriver.java
31 31
    private static DateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
32 32
    private static DateFormat timestampFormat = new SimpleDateFormat(
33 33
            "yyyy-MM-dd HH:mm:ss.SSSSSSSSS");
34

  
34
  
35 35
    static {
36 36
        try {
37 37
            Class.forName("org.hsqldb.jdbcDriver").newInstance();
......
42 42

  
43 43
    private ValueWriter vWriter = ValueWriter.internalValueWriter;
44 44
    protected JDBCSupport jdbcSupport;
45

  
45
    private Connection con = null;
46
    
46 47
    /**
47 48
     * @see com.hardcode.gdbms.engine.data.driver.DBDriver#getConnection(java.lang.String,
48 49
     *      int, java.lang.String, java.lang.String, java.lang.String)
......
54 55
        }
55 56

  
56 57
        String connectionString = "jdbc:hsqldb:file:" + dbName;
57

  
58
        return DriverManager.getConnection(connectionString, user, password);
58
        if (con == null){
59
        	con = DriverManager.getConnection(connectionString, user, password);
60
        }
61
        return con;
59 62
    }
60 63

  
61 64
    /**
trunk/libraries/libGDBMS/src/main/java/com/hardcode/gdbms/engine/data/db/DBDataSourceAdapter.java
136 136
     *
137 137
     * @throws SQLException if the connection cannot be established
138 138
     */
139
    protected Connection getConnection() throws SQLException {
139
    public Connection getConnection() throws SQLException {
140 140
        return driver.getConnection(host, port, dbName, user, password);
141 141
    }
142 142

  

Also available in: Unified diff