Donate Share

Ammentos Persistence Layer

The forum address has changed, you have been automatically redirected. Please update any bookmarks to use the new URL.

Subscribe

Error on Load with Query

You are viewing a single message from this topic. View all messages.

  1. 2008-05-20 23:12:43 UTC
    Hello:

    I'm testing Ammentos and get an error on load:

    it.biobytes.ammentos.PersistenceException: java.lang.IllegalArgumentException

    /**********************************/
    package test;


    import java.sql.*;

    import javax.sql.DataSource;
    import java.util.List;
    import java.util.ListIterator;

    import it.biobytes.ammentos.*;
    import it.biobytes.ammentos.query.Query;
    import it.biobytes.ammentos.query.SqlQueryFilter;
    import static it.biobytes.ammentos.FieldTypeEnum.*;

    public class TestAM {

    public static void main(String args[]) {

    Statement sentencia;
    ResultSet resultado;

    try {

    DataSource ds = new BaseDataSource("com.mysql.jdbc.Driver","jdbc:mysql://localhost/cdcol","root","");

    Ammentos.setDataSource( ds );


    SqlQueryFilter sqlqf = new SqlQueryFilter( " titel > ? " );
    sqlqf.setString( "0" );
    Query qry = new Query( sqlqf );

    /** here get error **/
    List<Cds> lp = Ammentos.load( Cds.class, qry );
    ListIterator<Cds> iter = lp.listIterator(lp.size());
    while (iter.hasNext())
    System.out.println(iter.next().getDescription());


    } catch (Exception e) {
    System.out.println(
    e.getMessage() );
    return;
    }

    }

    }

    /**********************************/


    regards
< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.