logo       

Sponsor
FREE Network Mapping Tool for Microsoft® Office Visio® Professional 2007
Don't map your network by hand - let LANsurveyor Exx press for Microsoft Visio Professional 2007 automatically create network diagrams for you!

[jira] Updated: (DERBY-149) Server hang when invalid string is bound to dat: msg#00257

apache.db.derby.devel

Subject: [jira] Updated: (DERBY-149) Server hang when invalid string is bound to datetime columns.

[ http://issues.apache.org/jira/browse/DERBY-149?page=history ]

A B updated DERBY-149:
----------------------

Description:
When running against Derby Network Server with the JCC driver, attempts to bind
an invalid date/time string to a date/time/timestamp parameter lead to a hang
in either the JCC client or in the Network Server (not sure which).

The problem does NOT occur if the same thing is run against a DB2 server, which
suggests the bug is in Network Server, not in the JCC driver. That said,
though, the problem also does NOT happen if one uses an ODBC client to connect
to Network Server, instead of a JDBC client--so perhaps it's a problem with
JCC, after all...hard to say one way or the other...

Here's a simple program to reproduce the problem:

import java.sql.*;

public class go {

public static void main (String[] args) throws Exception {

Class.forName("com.ibm.db2.jcc.DB2Driver");
Connection c = DriverManager.getConnection(
"jdbc:derby:net://localhost:1527/ugh;create=true",
"bah", "humbug");

Statement s = c.createStatement();
try {
s.execute("drop table dt");
} catch (SQLException se) {}

s.execute("create table dt (d date)");
PreparedStatement pSt = c.prepareStatement("insert into dt
values (?)");

try {
pSt.setString(1, "oops"); // invalid date value.
pSt.execute();
} catch (SQLException se) {
System.out.println("Got " + se.getSQLState() + ": " +
se.getMessage());
}
}

}

Of course, in order for the program to run, one must start the Network Server
on port 1527 first.

was:
When running against Derby Network Server with the JCC driver, attempts to bind
an invalid date/time string to a date/time/timestamp parameter lead to a hang
in the client program.

The problem does NOT occur if the same thing is run against a DB2 server, which
suggests the bug is in Network Server, not in the JCC driver. That said,
though, the problem also does NOT happen if one uses an ODBC client to connect
to Network Server, instead of a JDBC client--so perhaps it's a problem with
JCC, after all...hard to say one way or the other...

Here's a simple program to reproduce the problem:

import java.sql.*;

public class go {

public static void main (String[] args) throws Exception {

Class.forName("com.ibm.db2.jcc.DB2Driver");
Connection c = DriverManager.getConnection(
"jdbc:derby:net://localhost:1527/ugh;create=true",
"bah", "humbug");

Statement s = c.createStatement();
try {
s.execute("drop table dt");
} catch (SQLException se) {}

s.execute("create table dt (d date)");
PreparedStatement pSt = c.prepareStatement("insert into dt
values (?)");

try {
pSt.setString(1, "oops"); // invalid date value.
pSt.execute();
} catch (SQLException se) {
System.out.println("Got " + se.getSQLState() + ": " +
se.getMessage());
}
}

}

Of course, in order for the program to run, one must start the Network Server
on port 1527 first.


The description originally said that the hang was in the "client program." I'm
changing it to say that the hang is either in the JCC client or else in the
Network Server, since that seems like a more accurate statement.

> Server hang when invalid string is bound to datetime columns.
> -------------------------------------------------------------
>
> Key: DERBY-149
> URL: http://issues.apache.org/jira/browse/DERBY-149
> Project: Derby
> Type: Bug
> Components: Network Server
> Environment: Derby running with Network Server via JDBC universal driver.
> Reporter: A B

>
> When running against Derby Network Server with the JCC driver, attempts to
> bind an invalid date/time string to a date/time/timestamp parameter lead to a
> hang in either the JCC client or in the Network Server (not sure which).
> The problem does NOT occur if the same thing is run against a DB2 server,
> which suggests the bug is in Network Server, not in the JCC driver. That
> said, though, the problem also does NOT happen if one uses an ODBC client to
> connect to Network Server, instead of a JDBC client--so perhaps it's a
> problem with JCC, after all...hard to say one way or the other...
> Here's a simple program to reproduce the problem:
> import java.sql.*;
> public class go {
> public static void main (String[] args) throws Exception {
> Class.forName("com.ibm.db2.jcc.DB2Driver");
> Connection c = DriverManager.getConnection(
> "jdbc:derby:net://localhost:1527/ugh;create=true",
> "bah", "humbug");
> Statement s = c.createStatement();
> try {
> s.execute("drop table dt");
> } catch (SQLException se) {}
> s.execute("create table dt (d date)");
> PreparedStatement pSt = c.prepareStatement("insert into dt
> values (?)");
> try {
> pSt.setString(1, "oops"); // invalid date value.
> pSt.execute();
> } catch (SQLException se) {
> System.out.println("Got " + se.getSQLState() + ": " +
> se.getMessage());
> }
> }
> }
> Of course, in order for the program to run, one must start the Network Server
> on port 1527 first.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira




<Prev in Thread] Current Thread [Next in Thread>
Sponsor
FREE Network Mapping Tool for Microsoft® OfficeVisio Professional 2007
Don't map your network by hand - let LANsurveyor Express for Microsoft Visio Professional 2007
automatically create network diagrams for you!
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | sitemap | advertise | OSDir is an inevitable website. super tiny logo