Tds9Test (jTDS API)
Date: 2013-06-08

net.sourceforge.jtds.jdbc

## Class Tds9Test

- java.lang.Object
- - TestCase
  - - net.sourceforge.jtds.jdbc.TestBase
    - - net.sourceforge.jtds.jdbc.Tds9Test

-     public class Tds9Test
      extends TestBase

  Test case to illustrate use of TDS 9 support

- - ### Field Summary

    - ### Fields inherited from class net.sourceforge.jtds.jdbc.TestBase

      `con, props`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Tds9Test(java.lang.String name)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `main(java.lang.String[] args)`
    `static Test` | `suite()`
    `private boolean` | `supportsTDS9()`
    `void` | `testImage()`
    `void` | `testNvarcharMaxOutput()` SQL 2005 allows nvarchar(max) as the output parameter of a stored procedure.
    `void` | `testReadNvarcharMax()`
    `void` | `testReadUDT()` Test UDT.
    `void` | `testReadVarbinaryMax()`
    `void` | `testReadVarcharMax()`
    `void` | `testReadXML()`
    `void` | `testVarbinaryMaxOutput()` SQL 2005 allows varbinary(max) as the output parameter of a stored procedure.
    `void` | `testVarcharMaxOutput()` SQL 2005 allows varchar(max) as the output parameter of a stored procedure.
    `void` | `testWriteNtext()`
    `void` | `testWriteNvarcharMax()`
    `void` | `testWriteText()`
    `void` | `testWriteVarbinaryMax()`
    `void` | `testWriteVarcharMax()`
    `void` | `testWriteXML()`
    `void` | `testXMLFunction()`
    `void` | `testXMLout()` SQL 2005 allows varbinary(max) as the output parameter of a stored procedure.

    - ### Methods inherited from class net.sourceforge.jtds.jdbc.TestBase

      `compareInputStreams, compareReaders, connect, dropDatabase, dropFunction, dropProcedure, dropTable, dropTrigger, dropType, dropView, dump, dump, dumpAll, dumpKeys, dumpRow, dumpRow, getConnection, getConnection, makeObjects, makeTestTables, setUp, tearDown`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Tds9Test

          public Tds9Test(java.lang.String name)

  - ### Method Detail

    - #### suite

          public static Test suite()

    - #### testReadUDT

          public void testReadUDT()
                           throws java.lang.Exception

      Test UDT. To run this test you will need to compile and install the following C# class into the target server: namespace UDT { using System; using System.Data.SqlTypes; using Microsoft.SqlServer.Server; using System.Runtime.InteropServices; [SqlUserDefinedType(Format.Native, IsByteOrdered = true)] [Serializable] [StructLayout(LayoutKind.Sequential)] public struct JtdsUDT : INullable { int x; private bool valueSet; public override string ToString() { return (valueSet) ? String.Format("{0:d}", x) : "null"; } public bool IsNull { get { return !valueSet; } } public static JtdsUDT Null { get { return new JtdsUDT(); } } public static JtdsUDT Parse(SqlString s) { if (s.IsNull || s.Value.ToLower() == "null") { return Null; } JtdsUDT t = new JtdsUDT(); t.x = int.Parse(s.ToString()); t.valueSet = true; return t; } } } Use the following TSQL to install the type: create assembly JtdsUDT from 'C:\JtdsUDT.dll' go create type JtdsUDT external name JtdsUDT.[UDT.JtdsUDT] go
      Throws:
        `java.lang.Exception`

    - #### testXMLFunction

          public void testXMLFunction()
                               throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### testReadXML

          public void testReadXML()
                           throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### testReadVarcharMax

          public void testReadVarcharMax()
                                  throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### testReadNvarcharMax

          public void testReadNvarcharMax()
                                   throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### testReadVarbinaryMax

          public void testReadVarbinaryMax()
                                    throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### testWriteVarcharMax

          public void testWriteVarcharMax()
                                   throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### testWriteNvarcharMax

          public void testWriteNvarcharMax()
                                    throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### testWriteVarbinaryMax

          public void testWriteVarbinaryMax()
                                     throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### testWriteXML

          public void testWriteXML()
                            throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### testWriteText

          public void testWriteText()
                             throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### testWriteNtext

          public void testWriteNtext()
                              throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### testImage

          public void testImage()
                         throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### testVarcharMaxOutput

          public void testVarcharMaxOutput()
                                    throws java.lang.Exception

      SQL 2005 allows varchar(max) as the output parameter of a stored procedure. Test this functionality now.
      Throws:
        `java.lang.Exception`

    - #### testNvarcharMaxOutput

          public void testNvarcharMaxOutput()
                                     throws java.lang.Exception

      SQL 2005 allows nvarchar(max) as the output parameter of a stored procedure. Test this functionality now.
      Throws:
        `java.lang.Exception`

    - #### testVarbinaryMaxOutput

          public void testVarbinaryMaxOutput()
                                      throws java.lang.Exception

      SQL 2005 allows varbinary(max) as the output parameter of a stored procedure. Test this functionality now.
      Throws:
        `java.lang.Exception`

    - #### testXMLout

          public void testXMLout()
                          throws java.lang.Exception

      SQL 2005 allows varbinary(max) as the output parameter of a stored procedure. As xml columns will not be converted to varchar or nvarchar automatically the driver must supply an xml output parameter. JDBC 4 includes a new Types constant called SQLXML internal value 2009. In anticipation of JDBC 4 this driver now supports using this constant to set the correct type of output parameter.
      Throws:
        `java.lang.Exception`

    - #### main

          public static void main(java.lang.String[] args)

    - #### supportsTDS9

          private boolean supportsTDS9()
                                throws java.lang.NumberFormatException,
                                       java.sql.SQLException

      Throws:
        `java.lang.NumberFormatException`
        `java.sql.SQLException`

Generated on June 8 2013