aspose file tools*
The moose likes JDBC and the fly likes JavaOne - JDBC Spec Enhancements Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JavaOne - JDBC Spec Enhancements" Watch "JavaOne - JDBC Spec Enhancements" New topic
Author

JavaOne - JDBC Spec Enhancements

Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3707
    
    5

Just finished a JDBC Spec discussion with four members of the team actively writing the spec, some interesting new features such as setSchema() and Named Prepared Statements. I've written some highlights here: http://www.selikoff.net/blog/2009/06/03/live-from-javeone-jdbc-spec-enhancements/

Feel free to discuss.


My Blog: Down Home Country Coding with Scott Selikoff
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3832

Read it, Thanks Scott. I have one question there. Under the third enhancement how that will affect the connection pooling?
When the developer is allowed to change a preconfigured connection's (from a set of connections in the pool) schema and once he done with it the connection will return to the pool with other connections pointing to another schema. The developer must take the responsibility to make sure they are used properly? . Is this for an Application using several schemas (I never worked with such)?. This is just a thought I had after reading this.


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3707
    
    5

Good question. It was 9pm when I had at that technical session so I was pretty tired (full day of classes). My guess would be it would be up to vendors who build the servers to ensure some amount of security in setSchema(). For example, in a connection pool environment, the command may throw a security exception.
Kavita Tipnis
Ranch Hand

Joined: Sep 21, 2008
Posts: 177
Scott,

Under the 4th enhancement why a DATETIME datatype is not considered?
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3707
    
    5

Do you mean Java Timestamp? From what I gleaned, the time zone issues aren't going to be solved in 4.1, one of the reasons cited being they need to implement a design solution that is backwards compatible with existing JDBC code. We'll have to see what they come up with down the road.
Kavita Tipnis
Ranch Hand

Joined: Sep 21, 2008
Posts: 177
My naive look comparing the MySQL date/time datetime and timestamp datatypes to map with one of the data types in java.sql package brought that question.

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

One thing I'd like to see in JDBC is this:

In the Statement interface there is an "executeUpdate(String sql, int autoGeneratedKeys)" method which allows you to ask for the keys generated by an INSERT statement. But the PreparedStatement interface doesn't have an "executeUpdate(int autoGeneratedKeys)" method corresponding to that. It's a design defect so all the people who reported it as a bug were brushed off with the excuse that they should have filed an RFE instead.
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3707
    
    5

They did have a discussion about new features with autogenerated keys, but I'll have to wait till they release the slides to discuss.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3832

Scott Selikoff wrote:For example, in a connection pool environment, the command may throw a security exception.

They did have a discussion about new features with autogenerated keys, but I'll have to wait till they release the slides to discuss.


Well, we'll have to wait a little bit then. Thanks Scott.

 
 
subject: JavaOne - JDBC Spec Enhancements