Hello experts,
I’m having problems performing queries to a MBO. I have created a MBO named “Users” from a Sybase Anywhere table called “Users” witch possess three columns: username, password and name. I’m trying to get the name of user that possesses the username “Naruto”, for that purpose I’ve tried codding the following:
Attempt 1
Query query = new Query();
AttributeTest attributes = new AttributeTest();
attributes.setAttribute("username");
attributes.setValue("Naruto");
attributes.setOperator(AttributeTest.EQUAL);
query.select("x.name");
query.from("Users", "x");
query.where(attributes);
QueryResultSet rs = GAMEONDB.executeQuery(query);
Attempt2
Query query = new Query();
AttributeTest attributes = new AttributeTest();
attributes.setAttribute("x.username");
attributes.setValue("Naruto");
attributes.setOperator(AttributeTest.EQUAL);
query.select("x.name");
query.from("Users", "x");
query.where(attributes);
QueryResultSet rs = GAMEONDB.executeQuery(query);
Needless to say that the result set was empty in both attempts. I also tried these same attempts changing only query.where(attributes) to query.setTestCriteria(attributes), but the result set was also returned empty. Anyone has any idea of what am I doing wrong?
Best Regards,
Ricardo Pires