File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Database connection details in a AJAX book? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Database connection details in a AJAX book?" Watch "Database connection details in a AJAX book?" New topic
Author

Database connection details in a AJAX book?

Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10101
    
164

Kris,

I was going through the "Description" of your book here and saw the following statement:


They will also learn how to create database connections and multi-user applications while following identified design patterns


I am new to AJAX (have tried only a few HelloWorld examples) and my understanding of AJAX is that it is more of a client side technology. If that's right, then why would a book on AJAX elaborate about how to create database connections? Is there anything different in creating database connections in a AJAX application?

Apologies, if this question appears silly


[My Blog] [JavaRanch Journal]
Horst Naujoks
Greenhorn

Joined: Jul 12, 2002
Posts: 12
Normally an ajax app communicates to some server component like a servlet,jsp or ejb. While this component is responsible for the communication the database, you will find yourself in a familiar environment..

I've read the content of the book here: as far as I can see, this book focus primarily on the client side. The server side handles php, asp.net but not java.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10101
    
164

Normally an ajax app communicates to some server component like a servlet,jsp or ejb. While this component is responsible for the communication the database


Exactly. That's what my point is. Why would a AJAX book put in efforts to mention how database operations/connections are done, unless the way these things are done is different in AJAX applications.
[ December 19, 2006: Message edited by: Jaikiran Pai ]
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

Originally posted by Horst Naujoks:

Normally an ajax app communicates to some server component like a servlet,jsp or ejb. While this component is responsible for the communication the database, you will find yourself in a familiar environment..


your point acceptable by this manner to separate our business logic with presentation layer. but the thing why they do attached this thing with Ajax?

Please correct me if you find wrong something.

Thanks
[ December 19, 2006: Message edited by: Saif uddin ]

Saifuddin..
[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
Kris Hadlock
Author
Greenhorn

Joined: Nov 14, 2006
Posts: 26
Good question. I chose to cover database-enabled Ajax because it requires a different request model and the process of connecting to the server-side is quite different from a regular request. The areas that I focus on are making an XHR to a server-side "bridge" file, writing that "bridge" file to interact with server-side classes, making some simple database interactions and finally returning the data as valid XML. The differences in this process are making the request, creating the bridge file and returning the data as valid XML.


<a href="http://www.krishadlock.com" target="_blank" rel="nofollow">www.krishadlock.com</a><br /><a href="http://www.krishadlock.com/blog" target="_blank" rel="nofollow">www.krishadlock.com/blog</a><br /><a href="http://www.studiosedition.com" target="_blank" rel="nofollow">www.studiosedition.com</a><br /><a href="http://www.amazon.com/exec/obidos/redirect?link_code=as2&path=ASIN/0672329123&tag=krishadlock-20&camp=1789&creative=9325" target="_blank" rel="nofollow">Ajax for Web Application Developers</a>
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10101
    
164

I chose to cover database-enabled Ajax because it requires a different request model and the process of connecting to the server-side is quite different from a regular request.


Thanks Kris, that answers my question

The areas that I focus on are making an XHR to a server-side "bridge" file, writing that "bridge" file to interact with server-side classes, making some simple database interactions and finally returning the data as valid XML. The differences in this process are making the request, creating the bridge file and returning the data as valid XML.


This is something new that i am hearing. Would love to read more on this.
[ December 20, 2006: Message edited by: Jaikiran Pai ]
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

Thanks for your reply Kris,

Originally posted by Kris Hadlock:

I chose to cover database-enabled Ajax because it requires a different request model and the process of connecting to the server-side is quite different from a regular request.


but can you enlighten on this Request Model. I really like to read about it.
I mean what is XHR? is this file taking my connection code ? or what language we use to defining it.

Thanks again..
Kris Hadlock
Author
Greenhorn

Joined: Nov 14, 2006
Posts: 26
Saif,

XHR stands for the XMLHttpRequest Object, with JavaScript you can leverage this object to make requests to the server without refreshing the page. Without this object there would be no Ajax.

In my book I explain how to create database-enabled Ajax by making XHRs' to a PHP script, the PHP script makes method calls to a PHP class, which makes database interactions and returns responses as XML. The XML can then be parsed by JavaScript and re-rendered in the GUI. The best part is that it all occurs without refreshing the browser, which allows users to make other interactions while this process is happening in the background.
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

Thanks Kris Hadlock,

Oh! You know what i didn't know that XHR is a short term of XMLHttpRequest and i didn't heard before, by the way thanks for your reply and more clearing me on this Request Model and one more thing what programming language you use for defining example in your book, like you said PHP? I am not familiar with this language.

is your book useful for the Java Web programmers.(JavaScript, HMTL, JSP, Servlets)?
[ December 21, 2006: Message edited by: Saif uddin ]
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10101
    
164

Answered here
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Database connection details in a AJAX book?