forked from lucee/extension-jdbc-mssql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMSSQL.cfc
65 lines (45 loc) · 2.67 KB
/
MSSQL.cfc
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
<cfcomponent extends="types.Driver" output="false" implements="types.IDatasource">
<cfset this.className="{class-name}">
<cfset this.bundleName="{bundle-name}">
<cfset this.dsn="{connection-string}">
<cfset this.type.port=this.TYPE_FREE>
<cfset this.value.host="localhost">
<cfset this.value.port=1433>
<cfset fields=array()>
<cfset fields=array(
field("Select Method","SelectMethod","direct,cursor",true,"A hint to the driver that determines whether the driver requests a database cursor for Select statements. Performance and behavior of the driver are affected by this property, which is defined as a hint because the driver may not always be able to satisfy the requested method.<ul>
<li>Direct—When the driver uses the Direct method, the database server sends the complete result set in a single response to the driver when responding to a query.
<li>Cursor—When the driver uses the Cursor method, a server-side cursor is requested. The rows are retrieved from the server in blocks when returning forward-only result sets.</ul>","select")
,field("Send String Parameters as Unicode","sendStringParametersAsUnicode","true,false",true,"Set to ""false"" to specify that prepared parameters for character data are sent as ASCII instead of Unicode.
This parameter can improve performance for character data index lookup on non-Unicode, SQL Server 2000, or SQL Server 2005 tables. For example, ASCII row keys can be compared directly without the overhead of conversion from Unicode.","radio")
)>
<cfset data=struct()>
<cffunction name="customParameterSyntax" returntype="struct" output="no">
<cfreturn {leadingdelimiter:';',delimiter:';',separator:'='}>
</cffunction>
<cffunction name="onBeforeUpdate" returntype="void" output="no">
<cfset form.custom_DatabaseName=form.database>
</cffunction>
<cffunction name="getFields" returntype="array" output="no"
hint="returns array of fields">
<cfreturn fields>
</cffunction>
<cffunction name="getName" returntype="string" output="no"
hint="returns display name of the driver">
<cfreturn "{label}">
</cffunction>
<cffunction name="getId" returntype="string" output="no"
hint="returns the ID of the driver">
<cfreturn "{id}">
</cffunction>
<cffunction name="getDescription" returntype="string" output="no"
hint="returns description for the driver">
<cfreturn {description}>
</cffunction>
<cffunction name="equals" returntype="boolean" output="false"
hint="return if String class match this">
<cfargument name="className" required="true">
<cfargument name="dsn" required="true">
<cfreturn this.className EQ arguments.className and findNoCase("sqlserver",arguments.dsn)>
</cffunction>
</cfcomponent>