1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036
|
/*
Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
The MySQL Connector/C++ is licensed under the terms of the GPLv2
<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
MySQL Connectors. There are special exceptions to the terms and
conditions of the GPLv2 as it is applied to this software, see the
FLOSS License Exception
<http://www.mysql.com/about/legal/licensing/foss-exception.html>.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "../BaseTestFixture.h"
/**
* @author mmatthew
*
* To change this generated comment edit the template variable "typecomment":
* Window>Preferences>Java>Templates.
* To enable and disable the creation of type comments go to
* Window>Preferences>Java>Code Generation.
*/
namespace testsuite
{
namespace compliance
{
class StatementTest : public BaseTestFixture
{
private:
typedef BaseTestFixture super;
protected:
public:
TEST_FIXTURE(StatementTest)
{
TEST_CASE(testClearWarnings);
TEST_CASE(testClose);
TEST_CASE(testExecute01);
TEST_CASE(testExecute02);
TEST_CASE(testExecuteQuery01);
TEST_CASE(testExecuteQuery02);
TEST_CASE(testExecuteQuery03);
TEST_CASE(testExecuteUpdate01);
TEST_CASE(testExecuteUpdate03);
TEST_CASE(testGetMoreResults01);
TEST_CASE(testGetMoreResults02);
TEST_CASE(testGetMoreResults03);
TEST_CASE(testGetResultSet01);
TEST_CASE(testGetResultSet02);
TEST_CASE(testGetUpdateCount01);
TEST_CASE(testGetUpdateCount02);
TEST_CASE(testGetWarnings);
TEST_CASE(testGetResultSetType01);
TEST_CASE(testGetResultSetType02);
#ifdef INCLUDE_NOT_IMPLEMENTED_METHODS
TEST_CASE(testGetFetchSize);
TEST_CASE(testGetMaxFieldSize);
TEST_CASE(testSetMaxFieldSize02);
TEST_CASE(testGetMaxRows);
TEST_CASE(testSetMaxRows02);
TEST_CASE(testGetQueryTimeout);
TEST_CASE(testSetQueryTimeout02);
TEST_CASE(testSetFetchSize02);
TEST_CASE(testSetFetchSize05);
TEST_CASE(testSetMaxFieldSize01);
TEST_CASE(testSetMaxRows01);
#endif
#ifdef MISSING_METHODS_INCLUDED2STATEMENT
TEST_CASE(testSetFetchDirection04);
TEST_CASE(testGetResultSetType03);
TEST_CASE(testGetResultSetConcurrency01);
TEST_CASE(testGetFetchDirection);
#endif
}
/*
* @testName: testClearWarnings
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The ClearWarnings clears the SQLWarnings associated with
* the statement object. After a call to this method, a call
* to getWarnings will return a null SQLWarning object.
* (See JDK 1.2.2 API Documentation)
*
* @test_Strategy: Get a Statement object and call clearWarnings() method
* on the statement object.Further calling the getWarnings()
* method should return a null SQLWarning object
*
*/
/* throws std::exception * */
void testClearWarnings();
/*
* @testName: testClose
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The close method closes the statement object.When a Statement
* object is closed, its current ResultSet object, if one exists,
* is also closed. (See JDK 1.2.2 API Documentation)
*
* @test_Strategy: Get a Statement object and call close() method and call
* executeQuery() method to check and it should throw sql::DbcException
*
*/
/* throws std::exception * */
void testClose();
/*
* @testName: testExecute01
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The execute(String sql) method returns a boolean value; true
* if the first result is ResultSet or false if it is an integer.
* (See JDK 1.2.2 API Documentation)
*
* @test_Strategy: Call execute(String sql) of updating a row
* It should return a boolean value and the value should be
* equal to false
*
*/
/* throws std::exception * */
void testExecute01();
/*
* @testName: testExecute02
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The execute(String sql) method returns a boolean value;
* true if the first result is ResultSet or false if it is
* an integer. (See JDK 1.2.2 API Documentation)
*
* @test_Strategy: Get a Statement object and call execute(String sql)
* of selecting rows from the database
* It should return a boolean value and the value should be equal
* to true
*
*/
/* throws std::exception * */
void testExecute02();
/*
* @testName: testExecuteQuery01
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The executeQuery(String sql) method returns a ResultSet object;
* It may return an empty ResultSet object but never returns null.
* This method throws sql::DbcException if an error occurs in processing
* SQL statement or if the SQL statement generates a row count
* instead of ResultSet. (See JDK1.2.2 API documentation)
*
* @test_Strategy: Get a Statement object and call executeQuery(String sql)
* to select a row from the database
* It should return a ResultSet object
*
*/
/* throws std::exception * */
void testExecuteQuery01();
/*
* @testName: testExecuteQuery02
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The executeQuery(String sql) method returns a ResultSet object;
* It may return an empty ResultSet object but never returns null.
* This method throws sql::DbcException if an error occurs in processing
* SQL statement or if the SQL statement generates a row count
* instead of ResultSet. (See JDK1.2.2 API documentation)
*
* @test_Strategy: Get a Statement object and call executeQuery(String sql)
* to select a non-existent row from the database
* It should return a ResultSet object which is empty and call
* ResultSet.next() method to check and it should return a false
*
*/
/* throws std::exception * */
void testExecuteQuery02();
/*
* @testName: testExecuteQuery03
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The executeQuery(String sql) method returns a ResultSet object;
* It may return an empty ResultSet object but never returns null.
* This method throws sql::DbcException if an error occurs in processing
* SQL statement or if the SQL statement generates a row count
* instead of ResultSet. (See JDK1.2.2 API documentation)
*
*
* @test_Strategy: Get a Statement object and call executeQuery(String sql)
* to insert a row from the database
* It should throw sql::DbcException
*
*/
/* throws std::exception * */
void testExecuteQuery03();
/*
* @testName: testExecuteUpdate01
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The executeUpdate(String sql) method returns a integer value;
* The value indicates the number of rows affected by INSERT, DELETE
* or UPDATE specified in the sql; 0 if no rows were affected or the
* statement executed was a DDL statement.
* This method throws sql::DbcException if an error occurs in processing
* SQL statement or if the SQL statement generates a ResultSet.
* (See JDK1.2.2 API documentation)
*
* @test_Strategy: Get a Statement object and call executeUpdate(String sql)
* It should return an int value which is equal to row count
*/
/* throws std::exception * */
void testExecuteUpdate01();
/*
* @testName: testExecuteUpdate03
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The executeUpdate(String sql) method returns a integer value;
* The value indicates the number of rows affected by INSERT, DELETE
* or UPDATE specified in the sql; 0 if no rows were affected or the
* statement executed was a DDL statement.
* This method throws sql::DbcException if an error occurs in processing
* SQL statement or if the SQL statement generates a ResultSet.
* (See JDK1.2.2 API documentation)
*
* @test_Strategy: Get a Statement object and call executeUpdate(String sql)
* for selecting row from the table
* It should throw a SQL std::exception *
*
*/
/* throws std::exception * */
void testExecuteUpdate03();
#ifdef INCLUDE_NOT_IMPLEMENTED_METHODS
/*
* @testName: testGetFetchSize
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The getFetchSize() method returns a integer value;
* The value that is been set by the setFetchSize method.
* If no fetch size has been set, the return value is
* implementation specific. (See JDK1.2.2 API documentation)
*
* @test_Strategy: Get a ResultSet object and call the getFetchSize() method
* It should return a int value
*
*/
/* throws std::exception * */
void testGetFetchSize();
/*
* @testName: testGetMaxFieldSize
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The getMaxFieldSize() method returns a integer value;
* The value representing the current maximum number of bytes
* that a ResultSet column may contain. Zero means that there
* is no limit. (See JDK1.2.2 API documentation)
*
* @test_Strategy: Get a Statement object and call the getMaxFieldSize() method
* It should return a int value
*
*/
/* throws std::exception * */
void testGetMaxFieldSize();
/*
* @testName: testGetMaxRows
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The getMaxRows() method returns a integer value;
* The value representing the current maximum number of rows
* that a ResultSet object can contain. Zero means that there
* is no limit. (See JDK1.2.2 API documentation)
*
* @test_Strategy: Get a Statement object and call the getMaxRows() method
* It should return a int value
*
*/
/* throws std::exception * */
void testGetMaxRows();
#endif
/*
* @testName: testGetMoreResults01
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The getMoreResults() method returns a boolean value;
* true if the next result is ResultSet object; false if it is
* an integer indicating that it is an update count or there are
* no more results. There are no more results when the following
* condition is satisfied.
* (getMoreResults==false && getUpdatecount==-1)
* (See JDK1.2.2 API documentation)
*
* @test_Strategy: Get a Statement object and call the execute() method for
* selecting a row and call getMoreResults() method
* It should return a boolean value
*
*/
/* throws std::exception * */
void testGetMoreResults01();
/*
* @testName: testGetMoreResults02
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The getMoreResults() method returns a boolean value;
* true if the next result is ResultSet object; false if it is
* an integer indicating that it is an update count or there are
* no more results. There are no more results when the following
* condition is satisfied.
* (getMoreResults==false && getUpdatecount==-1)
* (See JDK1.2.2 API documentation)
*
* @test_Strategy: Get a Statement object and call the execute() method for
* selecting a non-existent row and call getMoreResults() method
* It should return a boolean value and the value should be
* equal to false
*
*/
/* throws std::exception * */
void testGetMoreResults02();
/*
* @testName: testGetMoreResults03
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The getMoreResults() method returns a boolean value;
* true if the next result is ResultSet object; false if it is
* an integer indicating that it is an update count or there are
* no more results. There are no more results when the following
* condition is satisfied.
* (getMoreResults==false && getUpdatecount==-1)
* (See JDK1.2.2 API documentation)
*
* @test_Strategy: Get a Statement object and call the execute() method for
* updating a row and call getMoreResults() method
* It should return a boolean value and the value should be
* equal to false
*
*/
/* throws std::exception * */
void testGetMoreResults03();
#ifdef INCLUDE_NOT_IMPLEMENTED_METHODS
/*
* @testName: testGetQueryTimeout
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The getQueryTimeout() method returns a integer value;
* The value indicates the current query timeout limit in
* seconds. Zero means that there is no time limit.
* (See JDK1.2.2 API documentation)
*
* @test_Strategy: Get a Statement object and call getMoreResults() method
* It should return a int value
*
*/
/* throws std::exception * */
void testGetQueryTimeout();
#endif
/*
* @testName: testGetResultSet01
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The getResultSet() method returns a ResultSet object;
* the current result set as a ResultSet object; null if the
* result is an integer indicating that it is an update count
* or there are no more results.(See JDK1.2.2 API documentation)
*
* @test_Strategy: Get a Statement object and call execute() method for
* selecting a row and call getResultSet() method
* It should return a ResultSet object
*
*/
/* throws std::exception * */
void testGetResultSet01();
/*
* @testName: testGetResultSet02
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The getResultSet() method returns a ResultSet object;
* the current result set as a ResultSet object; null if the
* result is an integer indicating that it is an update count
* or there are no more results.(See JDK1.2.2 API documentation)
*
* @test_Strategy: Get a Statement object and call execute() method for
* updating a row.Then call getResultSet() method
* It should return a Null ResultSet object
*/
/* throws std::exception * */
void testGetResultSet02();
/*
* @testName: testGetUpdateCount01
*
* @assertion: A driver must provide support for Statement and
* ResultSet. This implies that the methods in the
* Statement interface must be implemented and must behave as
* specified in the JDBC 1.0 and 2.0 specifications. (See
* Section :40.3 Statement Methods JDBC 2.0 API Tutorial
* & Reference).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The getUpdateCount() method should return a integer value;
* the value might be greater than 0 representing the rows affected;
* 0 if no rows are affected or if DDL statement; -1 if the result
* is a ResultSet object or there are no more results
* (See JDK 1.2.2 API Documentation)
*
* @test_Strategy: Get a Statement object and call the execute() method for
* updating a row and call getUpdateCount() method
* It should return a int value and the value should be
* equal to number of rows with the specified condition for update
*/
/* throws std::exception * */
void testGetUpdateCount01();
/*
* @testName: testGetUpdateCount02
*
* @assertion: A driver must provide support for Statement and
* ResultSet. This implies that the methods in the
* Statement interface must be implemented and must behave as
* specified in the JDBC 1.0 and 2.0 specifications. (See
* Section :40.3 Statement Methods JDBC 2.0 API Tutorial
* & Reference).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The getUpdateCount() method should return a integer value;
* the value might be greater than 0 representing the rows affected;
* 0 if no rows are affected or if DDL statement; -1 if the result
* is a ResultSet object or there are no more results
* (See JDK 1.2.2 API Documentation)
*
* @test_Strategy: Get a Statement object and call the execute() method for
* selecting a non-existent row and call getUpdateCount() method
* It should return a int value and the value should be
* equal to -1
*/
/* throws std::exception * */
void testGetUpdateCount02();
/*
* @testName: testGetWarnings
*
* @assertion: A driver must provide support for Statement and
* ResultSet. This implies that the methods in the
* Statement interface must be implemented and must behave as
* specified in the JDBC 1.0 and 2.0 specifications. (See
* Section :40.3 Statement Methods JDBC 2.0 API Tutorial
* & Reference).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The getWarnings() method should return a SQLWarning object;
* or null if there are no warnings (See JDK 1.2.2 API
* Documentation)
*
* @test_Strategy: Get a Statement object and call getWarnings() method
* should return an SQLWarning object
*/
/* throws std::exception * */
void testGetWarnings();
#ifdef INCLUDE_NOT_IMPLEMENTED_METHODS
/*
* @testName: testSetFetchSize02
* @assertion: A driver must provide support for Statement and
* ResultSet. This implies that the methods in the
* Statement interface must be implemented and must behave as
* specified in the JDBC 1.0 and 2.0 specifications. (See
* Section :40.3 Statement Methods JDBC 2.0 API Tutorial
* & Reference).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The setFetchSize(int rowsize) method sets the number of rows
* to fetch from the database specified by the value of rowsize.
* The setFetchSize does not return any value. (See JDK 1.2.2
* API Documentation)
*
* @test_Strategy: Get a Statement object and call the setFetchSize(int rows)
* method with the value of Statement.getMaxRows and call
* getFetchSize() method and it should return a int value
* that is been set
*/
/* throws std::exception * */
void testSetFetchSize02();
/*
* @testName: testSetFetchSize05
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The setFetchSize(int size) method sets the number of rows
* to fetch from the database specified by the value size.
* The method does not return any value and throws sql::DbcException
* if a database access error occurs or the condition
* 0 <= size <= this.getMaxRows is not satisfied.
* (See JDK 1.2.2 API Documentation)
*
* @test_Strategy: Get a Statement object and call the setFetchSize(int rows)
* method with the negative value and it should throw
* sql::DbcException
*
*/
/* throws std::exception * */
void testSetFetchSize05();
/*
* @testName: testSetMaxFieldSize01
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The setMaxFieldSize(int maxsize) method sets the maximum size
* for a column in a result set specified by the value maxsize (in
* bytes). For maximum portability, the maximum field size should
* be set to a value greater than 256. If the value maxsize is 0
* then it means that there is no limit to the size of a column.
* The setMaxFieldSize(int maxsize) does not return any value.
* (See JDK 1.2.2 API Documentation)
*
* @test_Strategy: Get a Statement object and call the setMaxFieldSize(int max)
* method and call getMaxFieldSize() method and it should return
* an integer value that is been set
*
*/
/* throws std::exception * */
void testSetMaxFieldSize01();
/*
* @testName: testSetMaxFieldSize02
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The setMaxFieldSize(int maxsize) method sets the maximum size
* for a column in a result set specified by the value maxsize (in
* bytes). For maximum portability, the maximum field size should
* be set to a value greater than 256. If the value maxsize is 0
* then it means that there is no limit to the size of a column.
* The setMaxFieldSize(int maxsize) does not return any value.
* (See JDK 1.2.2 API Documentation)
*
* @test_Strategy: Get a Statement object and call the setMaxFieldSize(int max)
* method with an invalid value (negative value) and It should
* throw a sql::DbcException
*
*/
/* throws std::exception * */
void testSetMaxFieldSize02();
/*
* @testName: testSetMaxRows01
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The setMaxRows(int maxsize) method sets the maximum number
* of rows that any ResultSet object can contain is specified
* by the value maxsize. If the value maxsize is 0 then it means
* that there is no limit. The setMaxRows(int maxsize) does not
* return any value.(See JDK 1.2.2 API Documentation)
*
* @test_Strategy: Get a Statement object and call the setMaxRows(int rows)
* method and call getMaxRows() method and it should return a
* integer value that is been set
*
*/
/* throws std::exception * */
void testSetMaxRows01();
/*
* @testName: testSetMaxRows02
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The setMaxRows(int maxsize) method sets the maximum number
* of rows that any ResultSet object can contain is specified
* by the value maxsize. If the value maxsize is 0 then it means
* that there is no limit. The setMaxRows(int maxsize) does not
* return any value.(See JDK 1.2.2 API Documentation)
*
* @test_Strategy: Get a Statement object and call the setMaxRows(int rows)
* method with an invalid value (negative value) and It should
* throw an sql::DbcException
*
*/
/* throws std::exception * */
void testSetMaxRows02();
/*
* @testName: testSetQueryTimeout02
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The setQueryTimeout(int secval) method sets the time limit
* for the number of secval seconds a driver will wait for a
* statement object to be executed. If the value secval is 0
* then it means that there is no limit. The setQueryTimeout
* method does not return any value. (See JDK 1.2.2 API
* Documentation)
*
* @test_Strategy: Get a Statement object and call the setQueryTimeout(int secval)
* method with an invalid value (negative value)and It should
* throw an sql::DbcException
*
*/
/* throws std::exception * */
void testSetQueryTimeout02();
#endif
/*
* @testName: testGetResultSetType01
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The getResultSetType() method returns an integer value;
* the value representing the type of the ResultSet objects
* and the value can be any one of the following
* ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_SENSITIVE
* and ResultSet.TYPE_SCROLL_INSENSITIVE.
* (See JDK1.2.2 API documentation)
*
* @test_Strategy: Get a Statement object and call getResultSetType() method
* It should return an int value which should be either
* TYPE_FORWARD_ONLY or TYPE_SCROLL_INSENSITIVE or TYPE_SCROLL_SENSITIVE
*/
/* throws std::exception * */
void testGetResultSetType01();
/*
* @testName: testGetResultSetType02
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The getResultSetType() method returns an integer value;
* the value representing the type of the ResultSet objects
* and the value can be any one of the following
* ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_SENSITIVE
* and ResultSet.TYPE_SCROLL_INSENSITIVE.
* (See JDK1.2.2 API documentation)
*
* @test_Strategy: Call Connection.createStatement with the Type mode as
* TYPE_FORWARD_ONLY and call getResultSetType() method
* It should return a int value and the value should be equal
* to ResultSet.TYPE_FORWARD_ONLY
*/
/* throws std::exception * */
void testGetResultSetType02();
#ifdef MISSING_METHODS_INCLUDED2STATEMENT
/*
* @testName: testSetFetchDirection04
* @assertion: A driver must provide support for Statement and
* ResultSet. This implies that the methods in the
* Statement interface must be implemented and must behave as
* specified in the JDBC 1.0 and 2.0 specifications. (See
* Section :40.3 Statement Methods JDBC 2.0 API Tutorial
* & Reference).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The setFetchDirection(int dir) method sets the statement
* object's fetch direction. The setFetchDirection method does
* not return any value. (See JDK 1.2.2 API Documentation)
*
* @test_Strategy: Get a Statement object and call the setFetchDirection(int direction)
* method with an invalid value and it should throw an sql::DbcException
*/
/* throws std::exception * */
void testSetFetchDirection04();
/*
* @testName: testGetResultSetConcurrency01
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The getResultSetConcurrency() method returns an integer value;
* the value representing the concurrency mode for the ResultSet
* objects and the value can be any one of the following
* ResultSet.CONCUR_READ_ONLY and ResultSet.CONCUR_UPDATABLE.
* (See JDK1.2.2 API documentation)
*
* @test_Strategy: Get a Statement object and call getResultSetConcurrency() method
* It should return an int value either CONCUR_READ_ONLY or
* CONCUR_UPDATABLE.
*/
/* throws std::exception * */
void testGetResultSetConcurrency01();
/*
* @testName: testGetResultSetType03
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The getResultSetType() method returns an integer value;
* the value representing the type of the ResultSet objects
* and the value can be any one of the following
* ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_SENSITIVE
* and ResultSet.TYPE_SCROLL_INSENSITIVE.
* (See JDK1.2.2 API documentation)
*
* @test_Strategy: Call Connection.createStatement with the Type mode as
* TYPE_SCROLL_INSENSITIVE and call getResultSetType() method
* It should return a int value and the value should be equal
* to ResultSet.TYPE_SCROLL_INSENSITIVE
*/
/* throws std::exception * */
void testGetResultSetType03();
/*
* @testName: testGetFetchDirection
* @assertion: The Statement object provides methods for executing SQL
* statements and retrieving results.(See section 40.1 of
* JDBC 2.0 API Reference & Tutorial second edition).
*
* The driver must provide full support for Statement methods.
* The driver must also support all the methods for executing
* SQL Statements in a single batch (Batch Updates). (See
* section 6.2.2.3 of Java2 Platform Enterprise Edition(J2EE)
* Specification v1.2)
*
* The getFetchDirection() method returns a integer value;
* The value that is been set by the setFetchDirection method.
* If no fetch direction has been set, the return value is
* implementation specific. (See JDK1.2.2 API documentation)
*
* @test_Strategy: Get a Statement object and call the getFetchDirection() method
* It should return a int value and the value should be equal to
* any of the values FETCH_FORWARD or FETCH_REVERSE or FETCH_UNKNOWN
*
*/
/* throws std::exception * */
void testGetFetchDirection();
#endif
};
REGISTER_FIXTURE(StatementTest);
}
}
|