开发者

Cometd, jquery and database

开发者 https://www.devze.com 2023-04-13 00:51 出处:网络
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 da

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

精彩评论

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

关注公众号