JDBCPersistentBB and .findall fuction error

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

JDBCPersistentBB and .findall fuction error

Kenefosa
Hi Jomi

I have got a problem with .findall(). I am using CArtAgO env to get keyboard inputs from users, agGUI receives the percept and passes it to the agL_Support who will query the database for resultset---code below:

+!comment_Pass(Pass_Comment) : true  
        <-.print (comment_Pass(Pass_Comment));
          .print(" This is your query result set: ");
          .findall(Playerno, tennis_players(Playerno,_,_,_,_,_,_,_,_,_,_,Leagueno), L); // SELECT Query
       .print(L).

//And this is the BB customisation:

agL_Support beliefBaseClass jason.bb.JDBCPersistentBB(
            "org.postgresql.Driver", //driver for postgresql
                        "jdbc:postgresql://localhost:5432/myDB", //URL connection
                        "******", //user
                        "******", //password
                        "[tennis_players(12, tennis_players)

//But when MAS is run this is what i get:
 
[JDBCPersistentBB] SQL Error in getRelevant for tennis_players(Playerno,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,Leagueno)
org.postgresql.util.PSQLException: ERROR: syntax error at end of input
  Position: 15
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2161)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1890)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:560)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:403)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:283)
        at jason.bb.JDBCPersistentBB.getCandidateBeliefs(JDBCPersistentBB.java:377)
        at jason.asSyntax.Literal.logicalConsequence(Literal.java:282)
        at jason.stdlib.findall.execute(findall.java:102)
        at jason.asSemantics.TransitionSystem.applyExecInt(TransitionSystem.java:666)
        at jason.asSemantics.TransitionSystem.applySemanticRule(TransitionSystem.java:222)
        at jason.asSemantics.TransitionSystem.reasoningCycle(TransitionSystem.java:1406)
        at jason.infra.centralised.CentralisedAgArch.run(CentralisedAgArch.java:205)
        at java.lang.Thread.run(Thread.java:744)

[agL_Support] []

Questions:
1) what i am doing wrong?
2) What is Position 15?
3) I have written a Java JDBC program that queries this table in the database, do I need the Java JDBC program for the .findall() function to work?

I have read your AgentSpeak book over and over, cant seem to get it; please your help will be appreciated.

Kenefosa
Loading...