001: //
002: // Copyright 1998 CDS Networks, Inc., Medford Oregon
003: //
004: // All rights reserved.
005: //
006: // Redistribution and use in source and binary forms, with or without
007: // modification, are permitted provided that the following conditions are met:
008: // 1. Redistributions of source code must retain the above copyright
009: // notice, this list of conditions and the following disclaimer.
010: // 2. Redistributions in binary form must reproduce the above copyright
011: // notice, this list of conditions and the following disclaimer in the
012: // documentation and/or other materials provided with the distribution.
013: // 3. All advertising materials mentioning features or use of this software
014: // must display the following acknowledgement:
015: // This product includes software developed by CDS Networks, Inc.
016: // 4. The name of CDS Networks, Inc. may not be used to endorse or promote
017: // products derived from this software without specific prior
018: // written permission.
019: //
020: // THIS SOFTWARE IS PROVIDED BY CDS NETWORKS, INC. ``AS IS'' AND
021: // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
022: // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
023: // ARE DISCLAIMED. IN NO EVENT SHALL CDS NETWORKS, INC. BE LIABLE
024: // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
025: // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
026: // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
027: // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
028: // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
029: // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
030: // SUCH DAMAGE.
031: //
032:
033: package com.internetcds.jdbc.tds;
034:
035: /**
036: * constants from the 4.2 TDS protocol
037: *
038: * @version $Id: TdsDefinitions.java,v 1.2 2007-10-19 13:23:55 sinisa Exp $
039: * @author Craig Spannring
040: * @author The FreeTDS project.
041: */
042: interface TdsDefinitions {
043: public static final String cvsVersion = "$Id: TdsDefinitions.java,v 1.2 2007-10-19 13:23:55 sinisa Exp $";
044:
045: //
046: // Define the type of database the driver is connection to.
047: //
048: public static final int SQLSERVER = 1;
049: public static final int SYBASE = 2;
050:
051: //
052: // Versions of the TDS protocol. Keep the values in order so code
053: // can recognize versions at or after a specified version.
054: //
055: public static final int TDS42 = 42;
056: public static final int TDS50 = 50;
057: public static final int TDS70 = 70;
058:
059: //
060: // Sub packet types
061: //
062: static final byte TDS_RET_STAT_TOKEN = (byte) 0x79; // 121
063: static final byte TDS_PROCID = (byte) 0x7C; // 124 TDS_PROCID
064: static final byte TDS7_RESULT_TOKEN = (byte) 129; // 0x81 TDS 7.0 only
065: static final byte TDS_COL_NAME_TOKEN = (byte) 0xA0; // 160 TDS 4.2 only
066: static final byte TDS_COL_INFO_TOKEN = (byte) 161; // 0xA1 TDS 4.2 only
067: static final byte TDS_TABNAME = (byte) 164; // 0xA4
068: static final byte TDS_UNKNOWN_0xA5 = (byte) 0xA5; // 0xA5
069: static final byte TDS_UNKNOWN_0xA7 = (byte) 0xA7; //
070: static final byte TDS_UNKNOWN_0xA8 = (byte) 0xA8; //
071: static final byte TDS_ORDER = (byte) 169; // 0xA9 TDS_ORDER
072: static final byte TDS_ERR_TOKEN = (byte) 170; // 0xAA
073: static final byte TDS_MSG_TOKEN = (byte) 171; // 0xAB
074: static final byte TDS_TEXT_UPD_TOKEN = (byte) 172; // 0xAC write- updatetext
075: static final byte TDS_LOGIN_ACK_TOKEN = (byte) 173; // 0xAD
076: static final byte TDS_CONTROL = (byte) 174; // 0xAE TDS_CONTROL
077: static final byte TDS_ROW_TOKEN = (byte) 209; // 0xD1
078: static final byte TDS_UNKNOWN_0xE2 = (byte) 226; // 0xE2
079: static final byte TDS_ENV_CHG_TOKEN = (byte) 227; // 0xE3
080: static final byte TDS_MSG50_TOKEN = (byte) 229; // 0xE5
081: static final byte TDS_RESULT_TOKEN = (byte) 238; // 0xEE
082: static final byte TDS_END_TOKEN = (byte) 253; // 0xFD TDS_DONE
083: static final byte TDS_DONEPROC = (byte) 254; // 0xFE TDS_DONEPROC
084: static final byte TDS_DONEINPROC = (byte) 255; // 0xFF TDS_DONEINPROC
085: // end of sub packet types
086:
087: //
088: // Native Column types
089: //
090: static final byte SYBVOID = 31; // 0x1F
091: static final byte SYBIMAGE = 34; // 0x22
092: static final byte SYBTEXT = 35; // 0x23
093: static final byte SYBVARBINARY = 37; // 0x25
094: static final byte SYBINTN = 38; // 0x26
095: static final byte SYBVARCHAR = 39; // 0x27
096: static final byte SYBBINARY = 45; // 0x2D
097: static final byte SYBCHAR = 47; // 0x2F
098: static final byte SYBINT1 = 48; // 0x30
099: static final byte SYBBIT = 50; // 0x32
100: static final byte SYBINT2 = 52; // 0x34
101: static final byte SYBINT4 = 56; // 0x38
102: static final byte SYBDATETIME4 = 58; // 0x3A
103: static final byte SYBREAL = 59; // 0x3B
104: static final byte SYBMONEY = 60; // 0x3C (does not allow nulls?)
105: static final byte SYBDATETIME = 61; // 0x3D
106: static final byte SYBFLT8 = 62; // 0x3E
107: static final byte SYBNTEXT = 99; // 0x63
108: static final byte SYBNVARCHAR = 103; // 0x67
109: static final byte SYBBITN = 104; // 0x68
110: static final byte SYBDECIMAL = 106; // 0x6A
111: static final byte SYBNUMERIC = 108; // 0x6C
112: static final byte SYBFLTN = 109; // 0x6D
113: static final byte SYBMONEYN = 110; // 0x6E
114: static final byte SYBDATETIMN = 111; // 0x6F
115: static final byte SYBMONEY4 = 112; // 0x70
116: static final byte SYBNCHAR = -17; // 0xEF
117: // XXX should SYBMONEY4 be 122 instead of 112?
118: static final byte SYBSMALLMONEY = 122; // 0x7A
119: // end of column types
120: }
|