开发者

Cometd, jquery and database

I would to retrieve data from DB with cometd and jquery! I can established a connection and making handshake, but I can't underst开发者_开发百科and how to send a calling to a page that retrieve my data from DB. Have you any idea?


Cometd and jquery don't provide database access.cometD is just scripting and you have to make db connection and getting data and putting on jquery cometD publish() function. That is takes data and put on channel that u make. That's it.

If you have any query then go to www.cometd.org


Cometd and jquery don't provide database access by themselves. What you need to do is developping a db layer on server side (using JPA if you develop server side in java). Then you need to plug your cometd code (server side) to your db layer. On the client side, cometdb will receive messages that you will feed in your web pages with jquery for example. You have some examples on the cometd web site,


As @unludo already mentioned, CometD and jQuery themselves are not meant to provide any DB access functionality. You will have to implement that on the server-side yourself.

Have a look at the CometD Primer here http://cometd.org/documentation/howtos/primer

The Maven archetype "cometd-archetype-jquery-jetty7" will generate a Maven project with CometD/Jetty + jQuery that you can immediately run with "mvn jetty:run".

The generated project uses the Spring Framework and therefore you can easily leverage the data access abstractions provided by Spring to implement your DB access requirements.

Have a look at http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/spring-data-tier.html

Good luck!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜