001package bradleyross.library.database; 002/** 003 * Subclass of DatabaseExtras for the SQLServer database 004 * manager by Microsoft. 005 * 006 * <p>The following are the date and time functions for SQL Server.</p> 007 * <ul> 008 * <li><b>DateAdd</b> Adds to a date (days, weeks, and so on)</li> 009 * <li><b>DateDiff</b> Calculates the difference between two dates</li> 010 * <li><b>DateName</b> Returns a string representation of date parts</li> 011 * <li><b>DatePart</b> Returns parts of a date (day of week, month, year, and so on)</li> 012 * <li><b>Day</b> Returns the day of month of a year</li> 013 * <li><b>GetDate</b> Returns the current date and time</li> 014 * <li><b>Month</b> Returns the month portion of a date</li> 015 * <li><b>Year</b> Returns the year portion of a date</li> 016 * </ul> 017 * @author Bradley Ross 018 * 019 */ 020public class SQLServer extends DatabaseExtras 021{ 022 public String getDbms() 023 { 024 return "sqlserver"; 025 } 026 protected void setup() 027 { 028 029 addTerm("CURRENTTIME", "GETDATE()"); 030 031 addTerm("DATE", "SMALLDATETIME"); 032 addTerm("DATETIME", "DATETIME"); 033 034 addTerm("DOUBLE", "DOUBLE"); 035 036 addTerm("FLOAT", "FLOAT"); 037 038 addTerm("LONGBLOB", "VARBINARY(MAX)"); 039 addTerm("LONGCLOB", "VARCHAR(MAX)"); 040 041 042 } 043}