Results 1 to 10 of 17

Thread: Database Feed

Hybrid View

  1. #1
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    521
    Hi Gerard,

    We haven't had time to work on this example yet, even if it would be pretty simple to implement.

    Basically, in the case of Java, it would be enough to take the Hello-World Data Adapter and add some JDBC code to poll a DB instead of generating pseudo-random data.

    Again, my call to anybody who has this example done to share it with the community.

    Thanks

  2. #2
    Member
    Join Date
    Apr 2008
    Location
    Muang
    Posts
    5

    Cool

    What are the pros and cons between

    1)reading directly from a DB source
    and
    2)reading from a file like xml

    I write a program to dynamically creates an XML file when a transaction takes place. Then feeds it to the LS. One file for each item with 6 fields.
    I have about 30 items in all.

  3. #3
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    521
    Amarin,

    The best approach would be to have an asynchronous data feed (based on some message-oriented middleware), which does not require polling. Both a DB and an XML data source are usually based on polling. That said, choosing between a DB and an XML file depends on many aspects, such as the polling frequency, the amount of data being polled, general architecture considerations, including transactions and fail-over. So it's impossible to provide a general answer.

  4. #4
    Member
    Join Date
    Apr 2008
    Location
    Muang
    Posts
    5

    Cool

    Thanks for your reply Alessandro

    What would the setup look like with MOM?
    Do I use it alongside lightstreamer?

    Would this be ok

    http://www.jboss.com/products/platforms/dataservices

    or

    http://www.jboss.org/projects/

    Do you recommend anything else?

    Thanks again

  5. #5
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    521
    Sure, any JMS implementation would be a perfect solution.
    By the way, you can find a JBoss-based example in the "Lightstreamer\DOCS-SDKs\sdk_adapter_java\examples\StockListDemo_JMS_D ataAdapter" folder of your Lightstreamer distribution.

  6. #6
    Member
    Join Date
    Jul 2008
    Location
    london
    Posts
    3

    Database Sample Code

    Hi there,

    I have to make a decision as to whether we can use Lightstreamer for a new project. Is there prospect of sample code for database integration being provided to developers in the near future.

    Regards

    Gerard

  7. #7
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    521
    I modified the HelloWorldDataAdapter to poll a database, instead of generating the data internally.

    Please consider this is just a five-minute effort and I've not tried to compile the code. Please let me know if you find any errors.

    This Data Adapter uses JDBC to query an Access file ("C:/Data.mdb"). Every second, it reads the first record, extracts the "message" and "timestamp" fields and injects them into the Lightstreamer Kernel.


 

 

Similar Threads

  1. .NET web service as Data Feed
    By icaiozzi in forum Adapter SDKs
    Replies: 1
    Last Post: November 19th, 2010, 11:52 AM
  2. How And Where To Specify Database As Data Feed?
    By devidasan in forum Adapter SDKs
    Replies: 1
    Last Post: March 17th, 2009, 11:00 AM
  3. .NET with external feed
    By markgoldin in forum Adapter SDKs
    Replies: 21
    Last Post: August 28th, 2008, 07:39 PM
  4. Database datafeed
    By Sinead in forum Adapter SDKs
    Replies: 4
    Last Post: February 14th, 2007, 03:47 PM
  5. Adapter Database Pulling
    By Excalibur in forum Adapter SDKs
    Replies: 4
    Last Post: October 3rd, 2006, 09:38 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 06:29 PM.