The Artima Developer Community
Sponsored Link

Articles Forum
Upcoming Features in JDBC 4

8 replies on 1 page. Most recent reply: Aug 18, 2006 12:39 AM by joe smith

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 8 replies on 1 page
Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Upcoming Features in JDBC 4 Posted: Sep 2, 2005 7:00 PM
Reply to this message Reply
Advertisement
JDBC 4 is the forthcoming release of the Java Database Connectivity API. Currently in Early Draft Review in the JCP (JSR 221), JDBC 4 is a major new release with a strong focus on ease-of-use and programmer productivity, and support for SQL 2003 data types, including SQL's native XML type. This article surveys the key JDBC 4 features.

http://www.artima.com/lejava/articles/jdbc_four.html

What do you think of the new JDBC 4 features?


Vic Cekvenich

Posts: 1
Nickname: netsql2
Registered: Sep, 2005

Re: Upcoming Features in JDBC 4 Posted: Sep 5, 2005 3:52 AM
Reply to this message Reply
Interesting.

Is any vendor planing to do a JDBC 4 driver?

.V

Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

Re: Upcoming Features in JDBC 4 Posted: Sep 6, 2005 8:12 AM
Reply to this message Reply
JDBC 4 is still in early draft review, which means it isn't a fully released standard yet. In fact, you are free to download the spec and comment on it, if you're interested. Once it becomes a fully approved JSR, vendors will no doubt start implementing JDBC4 - compliant drivers.

Harri Pesonen

Posts: 2
Nickname: fuerte
Registered: Sep, 2005

Re: Upcoming Features in JDBC 4 Posted: Sep 6, 2005 10:11 AM
Reply to this message Reply
Do we finally get multi-line (verbatim) string literals? Where you can't have escape sequences. Like the following:

Connection c = myDataSource.getConnection();
PreparedStatement st = c.prepareStatement("""
insert into siteusers (userid, username)
values (?, ?)
""";
st.setRowId(1, rowId1);

Here """ would mean that start of the string is in the next line, so that the beginning of the string would be properly intended. Here the resulting string would be:

insert into siteusers (userid, username)\nvalues (?, ?)

Brian Larson

Posts: 1
Nickname: briansbc
Registered: Sep, 2005

Re: Upcoming Features in JDBC 4 Posted: Sep 23, 2005 3:17 PM
Reply to this message Reply
I doubt it since this has nothing to do with JDBC. But, if you want that feature, check out Groovy: http://groovy.codehaus.org/Strings

Javid Jamae

Posts: 16
Nickname: javidjamae
Registered: Jan, 2003

Re: Upcoming Features in JDBC 4 Posted: Sep 27, 2005 11:28 AM
Reply to this message Reply
In the Type-safe querying and results code that you show, you never describe how the actual binding happens.

How does the system decide that when it runs the query defined in the annotation that it is going to create a DataSet of User objects? How does it know that each row of the query is going to be mapped into a User object and what fields on the database are to be mapped to each field on the object?

The fields may be associated by naming convention, but there seems to be something missing from the example that binds the User object to the user table.

interface MyQueries extends BaseQuery {
 
	@Query(sql="select * from user")
	DataSet getAllUsers();
}
 
.
.
.
 
Connection c = myDataSource.getConnection();
MyQueries myQueries = c.createQueryObject(MyQuery.class);
DataSet users = myQueries.getAllUsers();
for (User u: users) {
	System.out.println("User's name is: " + user.name;
}

Mathieu Gervais

Posts: 1
Nickname: patate
Registered: Oct, 2005

Re: Upcoming Features in JDBC 4 Posted: Oct 18, 2005 10:12 PM
Reply to this message Reply
> The fields may be associated by naming convention, but
> there seems to be something missing from the example that
> binds the User object to the user table.

From the JDBC4.0 spec pdf:

[...]
public class Mammal {
public String firstName;
public String lastName;
public int age;
public int weight;
public String description;
}
[...]
Methods decorated by Select annotations will return instances of DataSet<T>.

interface MyQueries extends BaseQuery {
@Select(sql="SELECT lastName, description FROM mammal")
DataSet<Mammal> getAllMammals();
[...]

DataSet<T> is your answer.

Josh Allen

Posts: 1
Nickname: firefight
Registered: Jun, 2006

Re: Upcoming Features in JDBC 4 Posted: Jun 16, 2006 7:53 PM
Reply to this message Reply
I'm literally drooling about the new JDBC 4 features. I almost wet my pants when I saw the Type Safe DataSets. I can't wait to be able to use this in production. Way Cool!!

joe smith

Posts: 21
Nickname: jetbrains
Registered: Jan, 2006

Re: Upcoming Features in JDBC 4 Posted: Aug 18, 2006 12:39 AM
Reply to this message Reply
JDBC 4.0 Enhancements in Java SE 6.
Auto-loading Driver is good feature.
In JDBC 4.0, we don't need the Class.forName() line.
http://www.developerzone.biz/

Flat View: This topic has 8 replies on 1 page
Topic: The Future of Mobile Java Previous Topic   Next Topic Topic: Interviews from JavaOne 2006: Day 4

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use