Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML
 
 
Search All Tutorials
  

 
Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML
 
JDBC
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments

More APIs Become Available

                         

3. More APIs Become Available:

Some APIs and new methods have been added in JDBC 6.0.

More APIs have been added to this version of JDBC to provide access to commonly implemented features of SQL:2003. In addition, several new methods have been added to commonly used interfaces to support easier and better data manipulation.

Now, let's review some working code and discuss the result of the Example1 class below. It will connect to an embedded Apache Derby database and display the query results in the console. Although JDBC 4.0 has been out for several months now, I found Apache Derby is the only database to provide a driver that even partially supports the JDBC 4.0 specification at the time of this writing (March 2007). All examples in this article are developed using JDK 1.6 and Apache Derby database version 10.2.2.0. For all code examples, I will show only snippets of the actual Java source file that are relevant to the discussion. See the Resources section for complete sample code discussed in this article.

EXAMPLE:


4. Changes in Connection and Statement Interface:

Some new features have been added to the Connection interface. However, first of all lets see the methods which are already in use to check whether a Connection object is still valid/active or not. 

int tenSeconds = 10;
Connection.isValid(tenSeconds);

In the above code the argument that specifies the time duration taken by the API to check whether the Connection is valid or not is Connection.isValid(int) that is Connection.isValid(tenSeconds);. This argument is the Timeout value. The value false will be returned if the timeout interval exceeds. And if the value returned is 0 for the time-out interval that indicates an Infinite Time-out Duration. Moreover the methods which are used for populating and retrieving the Client Information about a particular driver are:

Connection.getClientInfo()
Connection.setClientInfo(Properties) methods

also the methods which are used to retrieve the Client information individually are:

Connection.setClientInfo(String,String)
Connection.getClientInfo(String)

 Now lets see the methods which have been added to the Statement interface.

  1. Statement.isClosed() - If the Statement Object is closed it will return true by calling the Statement.close() method.
  2. Statement.setPoolable(boolean) - The call to Statement.setPoolable(true) will only act as a request to the Implementation to pool this Statement Object for better performance.
  3. Statement.isPoolable() - By default, only PreparedStatement and CallableStatement are pooled by the Implementation. Not all the implementations may support this feature and hence Applications should not depend on this feature always.

                         

Facing Programming Problem?
Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

3 comments so far (post your own) View All Comments Latest 10 Comments:

<%@ page contentType ="text/html" language ="java"%>

<%@ taglib uri ="http://java.sun.com/jstl/core" prefix ="c"%>
<html>
<head>
<h1><i><center>Candidates INFO</center></i></h1>
</head>
<body >
<font size="6" face="Times" text size="25">
<form action="">
<b>

Name:                      
<input type="text" name="name" size = "25">
<br>

Mobile No:              
<input type="number" name="mobileNumber" size = "25">
<br>

Contact No:             
<input type="number" name="contactNumber" size = "25">
<br>

Email Address:       
<input type="text" name="emailAddress" size = "25">
<br>

Contact Address:<br>
                           
       <textarea rows="10" cols="25" name="contactAddress"></textarea>
<br>

College:
                   
<input type="text" name="college" size="25">
<br>

Qualification:
         
<select name="qualification" >
<option value="B.E.,">B.E.,</option>
<option value="M.C.A">M.C.A</option>
<option value="B.Sc">B.Sc</option>
<option value="M.Sc">M.Sc</option>
</select>
           
Others:
<input type="text" name="others" size="25">
<br>

Year Of Passing:
     
<select name="yearOfPassing" >
<c:forEach var ="i" begin ="1975" end ="2009" varStatus ="j">
<option value ="${i}">${i}</option>
</c:forEach>
</select>
<br>


Percentage:
             
<select name="percentage" >
<c:forEach var="i" begin="55" end="99" varStatus="j">
<option value="${i}">${i}</option>
</c:forEach>
</select>
<br>

Department:
           
<select name="department">
<option value="CSE">CSE</option>
<option value="IT">IT</option>
<option value="ECE">ECE</option>
<option value="EEE">EEE</option>
<option value="E&I">E&I</option>
<option value="MECH">MECH</option>
<option value="CIVIL">CIVIL</option>
<option value="CHEMICAL">CHEMICAL</option>
</select>
<br>

Sex:
                           
<select name="sex" >
<option value="Male">Male</option>
<option value="Female">Female</option>
</select>
<br>

Date Of Birth:
         
<select name="date" >
<c:forEach var="i" begin="1" end="31">
<option value="${i}">${i}</option>
</c:forEach>
</select>
<select name="month" >
<c:forEach var="i" begin="1" end="12">
<option value="${i}">${i}</option>
</c:forEach>
</select>
<select name="year" >
<c:forEach var="i" begin="1960" end="2009">
<option value="${i}">${i}</option>
</c:forEach>
</select>
<br>

Prior Experience:
   
<select name="priorExperience" >
<option value="Yes">Yes</option>
<option value="No">No</option>
</select>               
Years Of Experience:
<select name="yearsOfExperience">
<c:forEach var="i" begin="1" end="15">
<option value="${i}">${i}</option>
</c:forEach>
</select>
<br>

Skill Set:                 
<font size=3>
1.<input type="text" name="skillSet1" size="25"><br>
                                                                   
2.<input type="text" name="skillSet2" size="25"><br>
                                                                   
3.<input type="text" name="skillSet3" size="25"><br>
                                                                   
4.<input type="text" name="skillSet4" size="25"><br>
                                                                   
5.<input type="text" name="skillSet5" size="25"><br>
                                                                   
6.<input type="text" name="skillSet6" size="25"><br>
</font size>

Fathers Name:         
<input type="text" name="fathersName" size="25">
<br>

Martial Status:         
<select name="martialStatus">
<option value="Married">Married</option>
<option value="Unmarried">Unmarried</option>
</select>
<br>

ExtraCurricular<br> Activities:                   
<select name="extraCurricularActivity">
<c:forEach var = "i" begin ="1" end ="10">
<option value= "${i}">${i}</option>
</c:forEach>
</select>

<center>
<input type="button" value="Submit" >
<input type="button" value="Cancel">
</center>

</b>
</font>
</form>
</script>
</body>
</html>

Posted by nithu on Saturday, 01.19.08 @ 11:20am | #45574

Connection.setClientInfo(Properties) methods

Posted by Connection.setClientInfo(Properties) methods on Friday, 01.11.08 @ 13:06pm | #44967

Connection.setClientInfo(Properties) methods

Posted by Connection.setClientInfo(Properties) methods on Friday, 01.11.08 @ 13:05pm | #44966

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Java String toLowerCase Example
Java String toCharArray Example
Java String substring Example
Java String indexOf Example
Java String startsWith Example
Java String hashCode Example
Java String matches Example
Java String length Example
Java String lastIndexOf Example
Java String isEmpty Example
Java String equalsIgnoreCase Example
Java String equals Example
Java String endsWith Example
Java String copyValueOf Example
Java String contentEquals Example
  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.