# Is it possible to take data from external database for the CDF embedded in webpage?

I have embedded my CDF in facebook.The data for the CDF should be taken from facebook server or my server dynamically.I tried out but its not working in dynamic code iam not able to access the data at all from both servers.Now i have the doubt is it possible to access data for the CDF from external databases.

-
Take a look at blog about Mathematica Enterprise Edition. image1, image2 – Vitaliy Kaurov Dec 30 '13 at 9:58
I think that it is fairly clear that a standalone CDF can Import data (you would need Enterprise Mathematica for DatabaseLink). The relevant part is likely about embedding. Can an embedded CDF access a database given that the plugin is sandboxed? I'm 99.9% sure that it can't, but haven't tested. Enterprise signing will not have any effect at all on the sandboxing here as far as I'm aware. – KAI Dec 30 '13 at 18:27

It is possible to access data via Import even in a (nonenterprise) .cdf. It must be a publicly available website (i.e., no login or passwords), and there may be other restrictions. In any case, here is code some that does the import:

imageNames = {"http://www.massmurdermedia.tv/images/TV%20Test%20Pattern%2007.jpg",
"http://www.testpattern.com.au/site_images/testpattern_main.gif"};
Manipulate[Import[imageNames[[i]]], {i, 1, Length[imageNames], 1,
ControlType -> PopupMenu}, SynchronousUpdating -> False, SaveDefinitions -> True]


Copy this and save as .cdf standalone. When you open it, you will be able to read in the two images from the internet (internet connection required). I don't know if this will work embedded in Facebook. If it doesn't then you can be pretty sure that no kind of Importing will work in that context. If it does, then you can just mimic this for the data in your application.

-
The above code works when i embed it in Facebook.It imports images from a webpage.But when i take data from database it was protected[Its not a open url].When it was protected it will not take the datas from that[missing the connection string].And i want the data to be dynamic in the sense it should be refreshed and display data from the server as soon as the data in the database was updated.I tried [Dynamic Refresh] and [timer] for auto refresh.both are not working.The CDF getting hanged up in the FB page whenever i use this in the code. – Bt Ambrishraman Dec 31 '13 at 8:23
Then if you want to use the .cdf's for this, you are going to have to work the problem from the other end: how can you get the data written into a form and into a location that the .cdf can read? – bill s Dec 31 '13 at 12:45
Thank you for your kind help. – Bt Ambrishraman Jan 2 '14 at 5:26