@Override
    protected void reconnect(Connection conn) throws DatabaseException {
        try {
			if (!DbUtils.hasTable(conn, TABLE_NAME)) {
			    // Need to create the table
			    DbUtils.execute(
			            conn, "CREATE cached TABLE STRUCTURE (STRUCTUREID bigint generated by default as identity (start with 1), " +
			            		"SESSIONID bigint not null, PARENTID bigint not null, HISTORYID int, " +
			            		"NAME varchar(8192) not null, NAMEHASH bigint not null, " +
			            		"URL varchar(8192) not null, METHOD varchar(10) not null)");
			}

			psRead	= conn.prepareStatement("SELECT * FROM STRUCTURE WHERE SESSIONID = ? AND STRUCTUREID = ?");

			psFind	= conn.prepareStatement("SELECT * FROM STRUCTURE WHERE SESSIONID = ? AND NAMEHASH = ? AND METHOD = ?");

			psInsert = conn.prepareStatement("INSERT INTO STRUCTURE (SESSIONID, PARENTID, HISTORYID, NAME, NAMEHASH, URL, METHOD) VALUES (?, ?, ?, ?, ?, ?, ?)");
			psGetIdLastInsert = conn.prepareCall("CALL IDENTITY();");

			psGetChildren = conn.prepareStatement("SELECT * FROM STRUCTURE WHERE SESSIONID = ? AND PARENTID = ?");

			psGetChildCount = conn.prepareStatement("SELECT COUNT(*) FROM STRUCTURE WHERE SESSIONID = ? AND PARENTID = ?");

		} catch (SQLException e) {
			throw new DatabaseException(e);
		}
    }
@ Override protected void reconnect ( Connection conn ) throws DatabaseException { try { if ( ! DbUtils . hasTable ( conn , TABLE_NAME ) ) { DbUtils . execute ( conn , "CREATE cached TABLE STRUCTURE (STRUCTUREID bigint generated by default as identity (start with 1), " + "SESSIONID bigint not null, PARENTID bigint not null, HISTORYID int, " + "NAME varchar(8192) not null, NAMEHASH bigint not null, " + "URL varchar(8192) not null, METHOD varchar(10) not null)" ) ; } psRead = conn . prepareStatement ( "SELECT * FROM STRUCTURE WHERE SESSIONID = ? AND STRUCTUREID = ?" ) ; psFind = conn . prepareStatement ( "SELECT * FROM STRUCTURE WHERE SESSIONID = ? AND NAMEHASH = ? AND METHOD = ?" ) ; psInsert = conn . prepareStatement ( "INSERT INTO STRUCTURE (SESSIONID, PARENTID, HISTORYID, NAME, NAMEHASH, URL, METHOD) VALUES (?, ?, ?, ?, ?, ?, ?)" ) ; psGetIdLastInsert = conn . prepareCall ( "CALL IDENTITY();" ) ; psGetChildren = conn . prepareStatement ( "SELECT * FROM STRUCTURE WHERE SESSIONID = ? AND PARENTID = ?" ) ; psGetChildCount = conn . prepareStatement ( "SELECT COUNT(*) FROM STRUCTURE WHERE SESSIONID = ? AND PARENTID = ?" ) ; } catch ( SQLException e ) { throw new DatabaseException ( e ) ; } }
/*
public RecordStructure(long structureId, long parentId, int historyId, String url) {