Name: sdR10048 Date: 05/06/2004
Filed By : SPB JCK team (###@###.###)
JDK :
JCK : 1.5
Platform[s] : Solaris
switch/Mode :
JCK test owner : http://javaweb.eng/jct/sqe/JCK-tck/usr/owners.jto
Failing Test [s] : N/A
Specification excerpt:
======================
--------- J2SE API spec v.1.5 ---------
...
public String getTableName(int columnIndex)
throws SQLException
Retrieves the name of the table from which the value in the designated column was derived.
Specified by:
getTableName in interface ResultSetMetaData
Parameters:
columnIndex - the first column is 1, the second is 2, and so on; must be between 1 and the number of columns, inclusive
Returns:
the table name or an empty String if no table name is available
Throws:
SQLException - if a database access error occurs or the given column number is out of bounds
...
---------- end-of-excerpt ---------------
Problem description
===================
The spec currently states that getTableName should return an empty string in the case if
no table name is available.
The implementation currently does return null in this case. Please address the mini test.
Minimized test:
===============
------- Test.java -------
import javax.sql.rowset.*;
import java.sql.*;
public class Test {
public static void main(String [] arg) {
RowSetMetaDataImpl meta = new RowSetMetaDataImpl();
try {
meta.setColumnCount(3);
} catch (SQLException e) {
System.out.println( "Unexpected (0) "+e );
}
try {
String output = meta.getTableName(2);
System.out.println("output: "+output);
} catch (SQLException e) {
System.out.println( "Unexpected "+e );
}
System.out.println( "finished" );
}
}
------- end-of-Test.java -------
Minimized test output:
======================
] java -showversion Test
java version "1.5.0-beta2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b49)
Java HotSpot(TM) Client VM (build 1.5.0-beta2-b49, mixed mode)
output: null
finished
JCK test source location:
==========================
/java/re/jck/1.5/promoted/latest/JCK-runtime-15/tests
======================================================================
Name: sdR10048 Date: 05/06/2004
The failing testcase is
api/javax_sql/rowset/RowSetMetaDataImpl/index.html#TableName[RowSetMetaDataImpl2011]
======================================================================
- duplicates
-
JDK-5038323 RowSetMetadataImpl.getTableName should return empty string instead null
-
- Resolved
-