JDBC Sample CallableStatementSample needs to be fixed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Trafodion |
Fix Released
|
High
|
xiu-zhu.zhang |
Bug Description
The JDBC CallableStateme
1. Have to create a library before creating procedure and should point to jar file, not class file.
2. Create procedure statement has to specify library name and remove external path. Also, the example SPJ does not have SQL, so no need for CONTAINS SQL clause.
3. Should not print cstmt, its printing some internal statement handle id.
4. README needs to be fixed: the class file should be put in a jar file. And the jar file has to be copied to all nodes in a cluster.
Here is the fixed sample code:
// @@@ START COPYRIGHT @@@
//
// (C) Copyright 2013-2014 Hewlett-Packard Development Company, L.P.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// @@@ END COPYRIGHT @@@
import java.sql.*;
public class CallableStateme
{
public static void main(String args[]) throws Exception
{
try
{
try
{
try {
} catch (Exception e) {}
st = "drop library qaspj";
try {
} catch (Exception e) {}
st = "create library qaspj file '/home/
st = "create procedure CallableStateme
}
catch (SQLException e)
{
}
// get the CallableStatement object
int nRetVal = cstmt.getInt(1);
}
{
throw new Exception("Call to getWarnings is Failed!");
}
}
}
Changed in trafodion: | |
assignee: | Rajeswari Muddu (rajeswari-j-muddu) → Kevin Xu (kai-hua-xu) |
Changed in trafodion: | |
milestone: | none → r0.9 |
Changed in trafodion: | |
milestone: | r0.9 → r1.0 |
Changed in trafodion: | |
status: | New → In Progress |
Changed in trafodion: | |
status: | In Progress → Fix Committed |
Changed in trafodion: | |
status: | Fix Committed → Fix Released |
1. Have to create a library before creating procedure and should point to jar file, not class file.
To do: document the correct process in README
2. Create procedure statement has to specify library name and remove external path. Also, the example SPJ does not have SQL, so no need for CONTAINS SQL clause.
To do: Library is required. Remove CONTAINS SQL
3. Should not print cstmt, its printing some internal statement handle id.
To do: comment the log
4. README needs to be fixed: the class file should be put in a jar file. And the jar file has to be copied to all nodes in a cluster.
To do: document this comments in README