Package org.gdbms.engine.data

Examples of org.gdbms.engine.data.DataSource.beginTrans()


    }
   
    public void testUndoOrRedoClearsSelection() throws Exception {
        DataSource d = ds.getDataSource("persona", DataSourceFactory.UNDOABLE);
       
        d.beginTrans();
        d.setSelectedRows(new int[]{0});
        d.insertFilledRow(d.getRow(0));
        int[] sel = d.getSelectedRows();
        assertTrue(sel.length == 1);
        assertTrue(sel[0] == 0);
View Full Code Here


  private void testSQLInjection(String dsName, int mode) throws Exception {
    DataSource d = ds.getDataSource(dsName);

    Value value = ValueFactory.createValue("aaa'aaa");
   
    d.beginTrans();
    d.setFieldValue(0, 1, value);
    d.commitTrans();

    d.start();
    assertTrue(((BooleanValue) d.getFieldValue(0, 1).equals(value)).getValue());
View Full Code Here

    Value v3 = ValueFactory.createValue("apellido");
    Value v4 = ValueFactory.createValue(Date.valueOf("1998-09-05"));
    Value v5 = ValueFactory.createValue(Time.valueOf("4:30:01"));
    Value v6 = ValueFactory.createValue(Timestamp.valueOf("2005-09-05 4:30:01.666666666"));

    d.beginTrans();
    d.insertFilledRow(new Value[] {v1, v2, v3, v4, v5, v6});
    d.commitTrans();

        d.start();
    assertTrue(((BooleanValue) d.getFieldValue(3, 0).equals(v1)).getValue());
View Full Code Here

        Value v3 = ValueFactory.createValue("apellido");
        Value v4 = ValueFactory.createValue(Date.valueOf("1998-09-05"));
        Value v5 = ValueFactory.createValue(Time.valueOf("4:30:01"));
        Value v6 = ValueFactory.createValue(Timestamp.valueOf("2005-09-05 4:30:01.666666666"));

        d.beginTrans();
        d.insertFilledRow(new Value[] {v1, v2, v3, v4, v5, v6});
        d.setFieldValue(0, 1, ValueFactory.createNullValue());
        d.commitTrans();

        d.start();
View Full Code Here

        Value v4 = ValueFactory.createValue(Date.valueOf("1998-09-05"));
        Value v5 = ValueFactory.createValue(Time.valueOf("4:30:01"));
        Value v6 = ValueFactory.createValue(Timestamp.valueOf("2005-09-05 4:30:01.666666666"));

       
        d.beginTrans();
        int rc = (int) d.getRowCount();
        d.insertFilledRow(new Value[] {v1, v2, v3, v4, v5, v6});
        assertTrue(d.getRowCount() == rc+1);
        d.commitTrans();
    }
View Full Code Here

    Value v4 = ValueFactory.createValue(Date.valueOf("1998-09-05"));
    Value v5 = ValueFactory.createValue(Time.valueOf("4:30:01"));
    Value v6 = ValueFactory.createValue(Timestamp.valueOf("2005-09-05 4:30:01.666666666"));
    Value v7 = ValueFactory.createValue(3);
   
    d.beginTrans();
    d.insertFilledRow(new Value[] {v1, v2, v3, v4, v5, v6, v7});
    d.setFieldValue(0, 1, ValueFactory.createNullValue());
    d.commitTrans();
    }
   
View Full Code Here

    }
   
    public void testAutomaticDataSource() throws Exception{
    DataSource d = ds.getDataSource("persona");

        d.beginTrans();
        d.setFieldValue(0, 1, ValueFactory.createValue("la gacela"));
        d.commitTrans();
       
    d = ds.getDataSource("hsqldbpersona");
View Full Code Here

        d.setFieldValue(0, 1, ValueFactory.createValue("la gacela"));
        d.commitTrans();
       
    d = ds.getDataSource("hsqldbpersona");

        d.beginTrans();
        d.setFieldValue(0, 1, ValueFactory.createValue("la gacela"));
        d.commitTrans();
       
    assertTrue(true);
    }
View Full Code Here

        Value v1 = ValueFactory.createValue("Fernando");
        Value v2 = ValueFactory.createValue("Gonz�lez");

        DataSource d = ds.getDataSource("persona_created");

        d.beginTrans();
        d.insertFilledRow(new Value[]{
                v1,
                v2,
                ValueFactory.createValue(0L)
        });
View Full Code Here

   * @throws Exception DOCUMENT ME!
   */
  private void testUpdate(String dsName, int mode) throws Exception {
    DataSource d = ds.getDataSource(dsName);

    d.beginTrans();
    d.insertEmptyRow();
    d.setFieldValue(0, 1, ValueFactory.createValue("edicion1"));
    d.setFieldValue(1, 1, ValueFactory.createValue("edicion2"));
    d.setFieldValue(1, 2, ValueFactory.createValue("edicion2"));
    d.setFieldValue(3, 1, ValueFactory.createValue("edicion3"));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.