function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Michael DsozaMichael Dsoza 

Use of stored procedure to get data from salesforce ??????

Can I use stored procedure to get data from salesforce to my website ?

 

Actually, I need large amount of data from different different objects & for every object data I need to create connection in java to connect salesforce & it returns data and for another object data again i need to create connection that return data so is their any way so that I can send entire bunch of query at a time to salesforce that will retrieve all the data from set of query & return to my java code so i dont need to create many connection for each object ???

kiranmutturukiranmutturu

apex itself works as a stored procedure. There are no seperate concept like that.. but for ur requirement y cant u work with API programming?

Michael DsozaMichael Dsoza

I am using API itself but the problem is that for every object data I need to call my connection first then I fetch the data again for next object data again I need to call connection & so on...

 

So can i create one connection for set of query ? 

Or can i send set of query at a time to get data ?

bcoz to display summary, minimum i need to connect salesforce 6-7 times to get data from different-different object. so it will be better for me to create one connection to get all this data at a time then i ll manage this data at my end ???

 

rayjguyrayjguy

There may be a simpler solution in your case, but we use DBAmp to create a local copy of our salesforce data in SQL Server which is refreshed through the day.  We can then run queries against that using plain old SQL.

 

http://forceamp.com/

 

Cheers,

Ray

Michael DsozaMichael Dsoza

please tell me is there any other option to avoid more number of connection ?

 

Is their any method in the api that open the connection & when our task gets completed then i can close the connection ?

 

so that i can take entire data from one function & returning from function i close the connection.

 

Is there anything available like above in API ?

 

 

gsmithfarmergsmithfarmer

Our production web site keeps a hot copy of Salesforce in a local MySQL database (updated from Salesforce very 15 minutes).  We use CopyStorm from www.capstorm.com. We use it because the product is inexpensive and works for all of our targets (MySQL, SQL/Server, and H2)

 

Accessing much Salesforce directly from your web site can be problemattic unless you create some sort of connection pool that maintain at least one open connection to 
Salesforce. I use Apache/Tomcat as the middle tier and developed a custom resource that maintains a SFDC connection pool (works just like Tomcat JDBC connection pools but for SFDC).  This approach gives reasonable performance and support both read and write to SFDC.

 

For the actual communicatoin to SFDC we use the open source JavaForce libraries. I would prefer to use the open source SQLForce/Python work but have not figured out how to make it work with Tomcat's ressource pool properly.