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
Dheeraj ChaudharyDheeraj Chaudhary 

Connect oracle Database using apex code

How to get/load Oracle database / Sql server database / DB2 database/ Teradata DB data into Salesforce without using any Appexchange application and all. Can we code to load all these database data to Salesforce using Visualforce and Apex coding....I dont want any external integration tool and nor any Application provided by salesforce. ALL I want to do uaing Visualforce code and Apex code only...
Best Answer chosen by Dheeraj Chaudhary
NagendraNagendra (Salesforce Developers) 
Hi Dheeraj,

salesforce.com will not be able to connect directly to your database. 
But you have a few options. Here are two.

1. integrate the data into salesforce.com and store the data using the Force.com Web Services API. then build your Visualforce page on that data as needed. or you could use the Data Loader to update the data. More info: http://wiki.apexdevnet.com/index.php/Data_Loader

2. web-service enable your backend data and have apex make "callouts" (web service calls) to retrieve the data. there are some constraints about request and response size so please read the Apex Documentation links below for more information.

If your web service provides a WSDL, you can try to import it to Apex and Apex will auto-generate the apex classes. More info here: http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#StartTopic=Content/apex_web_services_wsdl2apex.htm

Or you can construct the web service message using the HTTP (RESTful) apex classes. More info here: http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#StartTopic=Content/apex_classes_restful.htm

Please mark this as solved if it helps.

Best Regards,
Nagendra.P

All Answers

NagendraNagendra (Salesforce Developers) 
Hi Dheeraj,

salesforce.com will not be able to connect directly to your database. 
But you have a few options. Here are two.

1. integrate the data into salesforce.com and store the data using the Force.com Web Services API. then build your Visualforce page on that data as needed. or you could use the Data Loader to update the data. More info: http://wiki.apexdevnet.com/index.php/Data_Loader

2. web-service enable your backend data and have apex make "callouts" (web service calls) to retrieve the data. there are some constraints about request and response size so please read the Apex Documentation links below for more information.

If your web service provides a WSDL, you can try to import it to Apex and Apex will auto-generate the apex classes. More info here: http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#StartTopic=Content/apex_web_services_wsdl2apex.htm

Or you can construct the web service message using the HTTP (RESTful) apex classes. More info here: http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#StartTopic=Content/apex_classes_restful.htm

Please mark this as solved if it helps.

Best Regards,
Nagendra.P
This was selected as the best answer
SandhyaSandhya (Salesforce Developers) 
Hi Dheeraj Chaudhary,

After some research I found below link from Salesforce document please refer that you will be able to get the solution.

https://developer.salesforce.com/page/Integrate_Salesforce.com_With_Your_On-premise_Database

Hope this helps you!

Please accept my solution as Best Answer if my reply was helpful. It will make it available for other as the proper solution. If you felt I went above and beyond, you can give me kudos.
 
Thanks and Regards
Sandhya