SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 39 | Next

Deepak Vohra

"Ajax in Oracle JDeveloper"

In the doGet method,
retrieve the value of the catalogId parameter.
String catalogId = request.getParameter(???catalogId???);
To obtain data from the database, create a JDBC connection from a
datasource. Create a DataSource object using an InitialContext
object lookup and from the DataSource object obtain a Connection
object.
InitialContext initialContext = new InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource)
initialContext.lookup(???java:comp/env/jdbc/AjaxConnect
ionDS???);
java.sql.Connection conn = ds.getConnection();
Create a Statement object, specify a SQL query to retrieve data
from the database for the catalogId value specified in the input form,
and obtain a ResultSet object with the executeQuery(String
query) method of the Statement object.
32 2 Developing an Ajax Web Application
Statement stmt = conn.createStatement();
String query = ???SELECT * from OE.Catalog
WHERE catalogId=??? + ?????™??? +
catalogId + ?????™???;
ResultSet rs = stmt.executeQuery(query);
Set the content type of the HttpServletResponse to text/xml,
and set the cache-control header to no-cache.
response.setContentType(???text/xml???);
response.setHeader(???Cache-Control???, ???no-cache???);
The response from the servlet is in the form of a XML DOM object.
Construct an XML DOM object that contains information about the
validity of the catalogId field value. If the ResultSet object is
empty, the catalogId field value is not defined in the database table
Catalog, therefore the catalogId field value is valid.


Pages:
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6