postgresql bonitasql connection
I've moved on - using postgres, stock, in a new, clean 7.2.2 studio
script looks like this:
import groovy.sql.Sql;
def result=[];
Sql sql = BonitaSql.newInstance("jdbc:postgres://172.17.0.2:5432/HFDataProd", "bonita_db_user", "bpm", new org.postgresql.Driver());
....
Trying to do this as simply and straightforward, stock, out-of-the-box as possible.
Problem is:
Ambiguous method overloading for method groovy.sql.Sql#.
Cannot resolve which method to invoke for [null] due to overlapping prototypes between:
[interface java.sql.Connection]
[interface javax.sql.DataSource]
Can I scream?
Thanks
This is a better way of moving a db table to a BDM:
//get the data into a resultset from the db of your choice
while(resultset.next()){
myBDM newBDO = new myBDM();
newBDO.setId = resultset.getInt("Id");
newBDO.setDescription = resultset.getString("Description");
newBDO.setStatus = resultset.getint("Status");
}
From a post I forgot about... :)
http://community.bonitasoft.com/node/22542#node-22572
regards
Seán
PS: If this reply answers your question, please mark a resolved
Sean, I worked on this... new script accesses data properly. Now just to get it where I want it.
import groovy.sql.Sql;
import java.sql.Driver;
def list=[];
Sql sql=BonitaSql.newInstance("jdbc:postgresql://172.17.0.2:5432/HFDataProd","bonita_db_user","bpm", new org.postgresql.Driver())
sql.eachRow("select * from customer") {
list += it.customerid;
list += it.customer;
list += it.password_open;
list += it.password_encrypted;
list += it.buyfor1;
list += it.buyfor2;
list += it.buyfor3;
list += it.buyfor4;
list += it.buyfor5;
list += it.lastchanged_date;
list += it.created_date;
};
return list;
Thanks
Ford
Your about a 12 hours time-zone differential from me but I'd love to pick your brain...
Comments
not a problem, 12 hours? That's a long way - Hawaii?
Ah only 7 hours...sure we can talk next week I can't today as I'm off to an Embassy for a well earned beverage. Something that doesn't happen very often in this country which is dry. Hope that's OK.
regards
Got it thanks,
will reply off this forum via LI to ensure confidentiality.
regards
Comments
Absolutely,
I've submitted a bug report. I can't get it to work either...
https://bonita.atlassian.net/browse/BBPMC-380
regards
Seán