Source Code Cross Referenced for DatabaseMetaDataJDBC3Test.java in  » Database-JDBC-Connection-Pool » jTDS » net » sourceforge » jtds » test » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database JDBC Connection Pool » jTDS » net.sourceforge.jtds.test 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // jTDS JDBC Driver for Microsoft SQL Server and Sybase
002:        // Copyright (C) 2004 The jTDS Project
003:        //
004:        // This library is free software; you can redistribute it and/or
005:        // modify it under the terms of the GNU Lesser General Public
006:        // License as published by the Free Software Foundation; either
007:        // version 2.1 of the License, or (at your option) any later version.
008:        //
009:        // This library is distributed in the hope that it will be useful,
010:        // but WITHOUT ANY WARRANTY; without even the implied warranty of
011:        // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
012:        // Lesser General Public License for more details.
013:        //
014:        // You should have received a copy of the GNU Lesser General Public
015:        // License along with this library; if not, write to the Free Software
016:        // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
017:        //
018:        package net.sourceforge.jtds.test;
019:
020:        import java.sql.DatabaseMetaData;
021:        import java.sql.ResultSet;
022:
023:        /**
024:         * Test JDBC3 extensions to <code>DatabaseMetaData</code>.
025:         *
026:         * @version $Id: DatabaseMetaDataJDBC3Test.java,v 1.2 2005/01/05 12:24:14 alin_sinpalean Exp $
027:         */
028:        public class DatabaseMetaDataJDBC3Test extends MetaDataTestCase {
029:
030:            public DatabaseMetaDataJDBC3Test(String name) {
031:                super (name);
032:            }
033:
034:            /**
035:             * Test meta data functions that return boolean values.
036:             */
037:            public void testBooleanOptions() throws Exception {
038:                DatabaseMetaData dbmd = con.getMetaData();
039:                //
040:                // Test JDBC 3 items
041:                //
042:                assertTrue("locatorsUpdateCopy", dbmd.locatorsUpdateCopy());
043:                assertTrue("supportsGetGeneratedKeys", dbmd
044:                        .supportsGetGeneratedKeys());
045:                assertTrue("supportsMultipleOpenResults", dbmd
046:                        .supportsMultipleOpenResults());
047:                assertTrue("supportsNamedParameters", dbmd
048:                        .supportsNamedParameters());
049:                assertFalse(
050:                        "supportsResultSetHoldability",
051:                        dbmd
052:                                .supportsResultSetHoldability(ResultSet.HOLD_CURSORS_OVER_COMMIT));
053:                assertFalse(
054:                        "supportsResultSetHoldability",
055:                        dbmd
056:                                .supportsResultSetHoldability(ResultSet.CLOSE_CURSORS_AT_COMMIT));
057:                assertTrue("supportsSavepoints", dbmd.supportsSavepoints());
058:                assertTrue("supportsStatementPooling", dbmd
059:                        .supportsStatementPooling());
060:            }
061:
062:            /**
063:             * Test meta data function that return integer values.
064:             */
065:            public void testIntOptions() throws Exception {
066:                DatabaseMetaData dbmd = con.getMetaData();
067:                //
068:                // JDBC3 functions
069:                //
070:                assertTrue("getDatabaseMajorVersion", dbmd
071:                        .getDatabaseMajorVersion() >= 0);
072:                assertTrue("getDatabaseMinorVersion", dbmd
073:                        .getDatabaseMinorVersion() >= 0);
074:                assertEquals("getResultSetHoldability",
075:                        ResultSet.HOLD_CURSORS_OVER_COMMIT, dbmd
076:                                .getResultSetHoldability());
077:                assertEquals("getSQLStateType", 1, dbmd.getSQLStateType());
078:                assertEquals("getJDBCMajorVersion", 3, dbmd
079:                        .getJDBCMajorVersion());
080:                assertEquals("getJDBCMinorVersion", 0, dbmd
081:                        .getJDBCMinorVersion());
082:            }
083:
084:            /**
085:             * Test meta data functions that return result sets.
086:             */
087:            public void testResultSets() throws Exception {
088:                DatabaseMetaData dbmd = con.getMetaData();
089:                ResultSet rs;
090:                //
091:                // JDBC3 Methods
092:                //
093:                rs = dbmd.getAttributes(null, null, null, null);
094:                assertTrue(checkColumnNames(rs, new String[] { "TYPE_CAT",
095:                        "TYPE_SCHEM", "TYPE_NAME", "ATTR_NAME", "DATA_TYPE",
096:                        "ATTR_TYPE_NAME", "ATTR_SIZE", "DECIMAL_DIGITS",
097:                        "NUM_PREC_RADIX", "NULLABLE", "REMARKS", "ATTR_DEF",
098:                        "SQL_DATA_TYPE", "SQL_DATETIME_SUB",
099:                        "CHAR_OCTET_LENGTH", "ORDINAL_POSITION", "IS_NULLABLE",
100:                        "SCOPE_CATALOG", "SCOPE_SCHEMA", "SCOPE_TABLE",
101:                        "SOURCE_DATA_TYPE" }));
102:                assertFalse(rs.next());
103:                rs.close();
104:                //
105:                rs = dbmd.getSuperTables(null, null, "%");
106:                assertTrue(checkColumnNames(rs, new String[] { "TABLE_CAT",
107:                        "TABLE_SCHEM", "TABLE_NAME", "SUPERTABLE_NAME" }));
108:                assertFalse(rs.next());
109:                rs.close();
110:                //
111:                rs = dbmd.getSuperTypes(null, null, "%");
112:                assertTrue(checkColumnNames(rs, new String[] { "TYPE_CAT",
113:                        "TYPE_SCHEM", "TYPE_NAME", "SUPERTYPE_CAT",
114:                        "SUPERTYPE_SCHEM", "SUPERTYPE_NAME" }));
115:                assertFalse(rs.next());
116:                rs.close();
117:            }
118:
119:            public static void main(String[] args) {
120:                junit.textui.TestRunner.run(DatabaseMetaDataJDBC3Test.class);
121:            }
122:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.