2.SQL Server Type 4 JDBC Driver sqlserver jdbc连接参数

jdbc连接Microsoft SQL Server 2014 关于jdbc连接Microsoft SQL Server 2014 阅读详情

参考:https://docs.oracle.com/cd/E13157_01/wlevs/docs30/jdbc_drivers/mssqlserver.html#wp1098977


Table 3-1 SQL Server Connection Properties 


Property
Description
AlwaysReportTriggerResults
OPTIONAL
{true | false}. Determines how the driver reports results generated by database triggers (procedures that are stored in the database and executed, or fired, when a table is modified). For Microsoft SQL Server 2005, this includes triggers fired by Data Definition Language (DDL) events.
If set to true, the driver returns all results, including results generated by triggers. Multiple trigger results are returned one at a time. Use the Statement.getMoreResults()method to retrieve individual trigger results. Warnings and errors are reported in the results as they are encountered.
If set to false (the default):
  • For Microsoft SQL Server 2005, the driver does not report trigger results if the statement is a single INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, GRANT, REVOKE, or DENY statement.
  • For other Microsoft SQL Server databases, the driver does not report trigger results if the statement is a single INSERT, UPDATE, or DELETE statement.
In this case, the only result that is returned is the update count generated by the statement that was executed (if errors do not occur). Although trigger results are ignored, any errors generated by the trigger are reported. Any warnings generated by the trigger are enqueued. If errors are reported, the update count is not reported.
The default is false.
AuthenticationMethod
{auto | kerberos | ntlm | userIdPassword}. Determines which authentication method the driver uses when establishing a connection.
If set to auto (the default), the driver uses SQL Server authentication, Kerberos authentication, or NTLM authentication when establishing a connection. The driver selects an authentication method based on a combination of criteria, such as whether the application provides a user ID, the driver is running on a Windows platform, and the driver can load the DLL required for NTLM authentication. See Using the AuthenticationMethod Property for more information about using the default value.
If set to kerberos, the driver uses Kerberos authentication. The driver ignores any user ID or password specified. This value is supported only when connecting to Microsoft SQL Server 2000 or higher.
If set to ntlm, the driver uses NTLM authentication if the DLL required for NTLM authentication can be loaded. If the driver cannot load the DLL, the driver throws an exception. The driver ignores any user ID or password specified.
If set to userIdPassword, the driver uses SQL Server authentication when establishing a connection. If a user ID is not specified, the driver throws an exception.
The User property provides the user ID. The Password property provides the password.
NOTE: The values type4, type2, and none are deprecated, but are recognized for backward compatibility. We recommend that you use the kerberos, ntlm, and userIdPassword value, respectively, instead.
See Authentication for more information about using authentication with the SQL Server driver.
CodePageOverride
OPTIONAL
Specifies the code page the driver uses when converting character data. The specified code page overrides the default database code page. All character data retrieved from or written to the database is converted using the specified code page. The value must be a string containing the name of a valid code page supported by your JVM, for example, CodePageOverride=CP950.
By default, the driver automatically determines which code page to use to convert Character data. Use this property only if you need to change the driver’s default behavior.
If a value is set for the CodePageOverride property and the SendStringParametersAsUnicode property is set to true, the driver ignores the SendStringParametersAsUnicode property and generates a warning. The driver always sends parameters using the code page specified by CodePageOverride if this property is specified.
ConnectionRetryCount
OPTIONAL
The number of times the driver retries connections to a database server until a successful connection is established. Valid values are 0 and any positive integer.
If set to 0, the driver does not try to reconnect after the initial unsuccessful attempt.
The ConnectionRetryDelay property specifies the wait interval, in seconds, used between attempts.
The default is 5.
ConnectionRetryDelay
OPTIONAL
The number of seconds the driver waits before retrying connection attempts when ConnectionRetryCount is set to a positive integer.
The default is 1.
ConvertNull
{1 | 0}. Controls how data conversions are handled for null values.
If set to 1 (the default), the driver checks the data type being requested against the data type of the table column storing the data. If a conversion between the requested type and column type is not defined, the driver generates an "unsupported data conversion" exception regardless of the data type of the column value.
If set to 0, the driver does not perform the data type check if the value of the column is null. This allows null values to be returned even though a conversion between the requested type and the column type is undefined.
The default is 1.
DatabaseName
OPTIONAL
The name of the database to which you want to connect.
DescribeParameters
{noDescribe | describeIfString}. Controls whether the driver attempts to determine, at execute time, how to send String parameters to the server based on the database data type. Sending String parameters as the type the database expects improves performance and prevents unexpected locking issues caused by data type mismatches.
The SendStringParametersAsUnicode property controls whether the driver sends String parameter values to the server as Unicode (for example, nvarchar) or non-Unicode (for example, varchar). This property helps applications in which character columns are all Unicode or all non-Unicode. For applications that access both Unicode and non-Unicode columns, a data type mismatch still occurs for some columns if the driver always sends String parameter values to the server in only one format.
If set to noDescribe, the driver does not attempt to describe SQL parameters to determine the database data type. The driver sends String parameter values to the server based on the setting of the SendStringParametersAsUnicode property.
If set to describeIfString, the driver attempts to describe SQL parameters to determine the database data type if one or multiple parameters has been bound as a String (using the PreparedStatement methods setString(), setCharacterStream(), and setAsciiStream()). If the driver can determine the database data type, the driver sends the String parameter data to the server as Unicode if the database type is an n-type (for example, nvarchar). If the database type is not an n-type, the driver converts the data to the character encoding defined by the parameter’s collation and sends the data to the server in that character encoding. If the driver cannot determine the data type of the parameters, it sends String parameter values to the server based on the setting of the SendStringParametersAsUnicode property.
The default is noDescribe.
EnableCancelTimeout
{true | false}. Determines whether a cancel request sent as the result of a query timing out is subject to the same query timeout value as the statement it cancels.
If set to true, the cancel request times out using the same timeout value, in seconds, that is set for the statement it cancels. For example, if your application sets Statement.setQueryTimeout(5) on a statement and that statement is cancelled because its timeout value was exceeded, a cancel request is sent that also will time out if its execution exceeds 5 seconds. If the cancel request times out, for example, because the server is down, the driver throws an exception indicating that the cancel request was timed out and the connection is no longer valid.
If set to false (the default), the cancel request does not time out.
EncryptionMethod
{noEncryption | SSL | requestSSL | loginSSL}. Determines whether SSL encryption is used to encrypt data and login requests transmitted over the network between the driver and database server. See Data Encryption for information about choosing between encrypting data, including login requests, and only encrypting login requests.
If set to SSL, the login request and data is encrypted using SSL. If the database server does not support SSL, the connection fails and the driver throws an exception. When SSL is enabled, the following properties also apply:
HostNameInCertificate
TrustStore
TrustStorePassword
ValidateServerCertificate
If set to requestSSL, the login request and data is encrypted using SSL. If the database server does not support SSL, the driver establishes an unencrypted connection.
If set to loginSSL, the login request is encrypted using SSL. Data is encrypted using SSL If the database server is configured to require SSL. If the database server does not require SSL, data is not encrypted and only the login request is encrypted.
NOTE: If SSL is enabled, the driver communicates with database protocol packets set by the server’s default packet size. Any value set by the PacketSize property is ignored.
See Data Encryption for more information about configuring data encryption.
See Performance Considerations for information about configuring this property for optimal performance.
The default is noEncryption.
HostNameInCertificate
OPTIONAL
{host_name | #SERVERNAME#}. Specifies a host name for certificate validation when SSL encryption is enabled ( EncryptionMethod=SSL) and validation is enabled ( ValidateServerCertificate=true). This property is optional and provides additional security against man-in-the-middle (MITM) attacks by ensuring that the server the driver is connecting to is the server that was requested.
If a host name is specified, the driver compares the specified host name to the DNSName value of the SubjectAlternativeName in the certificate. If a DNSName value does not exist, the driver compares the host name with the Common Name (CN) part of the certificate’s Subject name. If the values do not match, the connection fails and the driver throws an exception.
If #SERVERNAME# is specified, the driver compares the server name specified in the connection URL or data source of the connection to the DNSName value of the SubjectAlternativeName in the certificate. If a DNSName value does not exist, the driver compares the host name to the CN parts of the certificate’s Subject name. If the values do not match, the connection fails and the driver throws an exception.
NOTE: If multiple CN parts are present, the driver validates the host name against each CN part. If any one validation succeeds, a connection is established.
If unspecified, the driver does not validate the host name in the certificate.
If SSL encryption or certificate validation is not enabled, any value specified for this property is ignored.
See Data Encryption for information about configuring for authentication.
The default is an empty string.
HostProcess
OPTIONAL
The process ID of the application connecting to Microsoft SQL Server. The value is a string up to a maximum of 128 characters. The value of this property may be useful for database administration purposes. This value is stored in the hostprocess column of the:
  • sys.sysprocesses table (Microsoft SQL Server 2005)
  • master.dbo.sysprocesses table (Microsoft SQL Server 2000)
Microsoft SQL Server 7 does not store this value.
The default is 0.
InitializationString
Specifies one or multiple SQL commands to be executed by the driver after it has established the connection to the database and has performed all initialization for the connection. The following connection URL sets the handling of null values to the Microsoft SQL Server default:
jdbc:bea:sqlserver://server1:1433;
InitializationString=set ANSI_NULLS off;
DatabaseName=test
Multiple commands must be separated by semicolons. In addition, if this property is specified in a connection URL, the entire value must be enclosed in parentheses when multiple commands are specified. The following connection URL sets the handling of null values to the Microsoft SQL Server default and allows delimited identifiers:
jdbc:bea:sqlserver://server1:1433;
InitializationString=(set ANSI_NULLS off;
set QUOTED_IDENTIFIER on);DatabaseName=test
If the execution of a SQL command fails, the connection attempt also fails and the driver throws an exception indicating which SQL command or commands failed.
InsensitiveResultSetBufferSize
OPTIONAL
{-1 | 0 | x}. Determines the amount of memory used by the driver to cache insensitive result set data. It must have one of the following values:
If set to -1, the driver caches all insensitive result set data in memory. If the size of the result set exceeds available memory, an OutOfMemoryException is generated. Because the need to write result set data to disk is eliminated, the driver processes the data more efficiently.
If set to 0, the driver caches all insensitive result set data in memory, up to a maximum of 2 GB. If the size of the result set data exceeds available memory, the driver pages the result set data to disk. Because result set data may be written to disk, the driver may have to reformat the data to write it correctly to disk.
If set to x, where x is a positive integer, the driver caches all insensitive result set data in memory, using this value to set the size (in KB) of the memory buffer for caching insensitive result set data. If the size of the result set data exceeds the buffer size, the driver pages the result set data to disk. Because the result set data may be written to disk, the driver may have to reformat the data to write it correctly to disk. Specifying a buffer size that is a power of 2 results in more efficient memory use.
See Performance Considerations for information about configuring this property for optimal performance.
The default is 2048 (KB).
JavaDoubleToString
{true | false}. Determines whether the driver uses its internal conversion algorithm or the JVM conversion algorithm when converting double or float values to string values.
If set to true, the driver uses the JVM algorithm when converting double or float values to string values.
If set to false (the default), the driver uses its internal algorithm when converting double or float values to string. Setting the property to false improves performance; however, slight rounding differences can occur when compared to the same conversion using the JVM algorithm. These differences are within the allowable error of the double and float data types.
The default is false.
LoadLibraryPath
Specifies the directory the driver looks in for the DLL used for NTLM authentication. The value is the fully qualified path of the directory that contains the DLL. When you install the driver, the NTLM DLLs are placed in the WL_HOME /server/lib subdirectory, where WL_HOME is the directory in which you installed WebLogic Server.
By default, the driver looks for the NTLM authentication DLLs in a directory on the Windows system path defined by the PATH environment variable.
If you install the driver in a directory that is not on the Windows system path, you can set this property to specify the location of the NTLM authentication DLLs. For example, if you install the driver in a directory named "DataDirect" that is not on the Windows system path, you can use this property to specify the directory containing the NTLM authentication DLLs.
jdbc:bea:sqlserver://server3:1433;
DatabaseName=test;LoadLibraryPath=C:\DataDirect\lib;
User=test;Password=secret
See Configuring NTLM Authentication for more information about NTLM authentication.
LoginTimeout
The amount of time, in seconds, the driver waits for a connection to be established before returning control to the application and throwing a timeout exception.
If set to 0 (the default), the driver does not time out a connection request.
LongDataCacheSize
{-1 | 0 | x}. Determines whether the driver caches long data (images, pictures, long text, or binary data) in result sets. To improve performance, you can disable long data caching if your application retrieves columns in the order in which they are defined in the result set.
If set to -1, the driver does not cache long data in result sets. It is cached on the server. Use this value only if your application retrieves columns in the order in which they are defined in the result set.
If set to 0, the driver caches long data in result sets in memory. If the size of the result set data exceeds available memory, the driver pages the result set data to disk.
If set to x, where x is a positive integer, the driver caches long data in result sets in memory and uses this value to set the size (in KB) of the memory buffer for caching result set data. If the size of the result set data exceeds available memory, the driver pages the result set data to disk.
See Performance Considerations for information about configuring this property for optimal performance.
The default is 2048.
NetAddress
OPTIONAL
The Media Access Control (MAC) address of the network interface card of the application connecting to Microsoft SQL Server. This value is a string up to a maximum of 12 characters. The value of this property may be useful for database administration purposes. This value is stored in the net_address column of the:
  • sys.sysprocesses table (Microsoft SQL Server 2005)
  • master.dbo.sysprocesses table (Microsoft SQL Server 2000)
The default is 000000000000.
PacketSize
PacketSize={-1 | 0 | x}. Determines the number of bytes for each database protocol packet transferred from the database server to the client machine (Microsoft SQL Server refers to this packet as a network packet).
Adjusting the packet size can improve performance. The optimal value depends on the typical size of data inserted, updated, or returned by the application and the environment in which it is running. Typically, larger packet sizes work better for large amounts of data. For example, if an application regularly returns character values that are 10,000 characters in length, using a value of 32 (16 KB) typically results in improved performance.
If set to -1, the driver uses the default maximum packet size used by the database server.
If set to 0 (the default), the driver uses a packet size of 64 KB.
If set to x, an integer from 1 to 128, the driver uses a packet size that is a multiple of 512 bytes. For example, PacketSize=8means to set the packet size to 8 * 512 bytes (4096 bytes).
See Performance Considerations for information about configuring this property for optimal performance.
The default is 0.
Password
A case-insensitive password used to connect to your Microsoft SQL Server database. A password is required only if SQL Server authentication is enabled on your database. If so, contact your system administrator to obtain your password.
See Authentication for more information about configuring authentication.
PortNumber
OPTIONAL
The TCP port of the primary database server that is listening for connections to the Microsoft SQL Server database.
This property is supported only for data source connections.
The default is 1433.
ProgramName
OPTIONAL
The name of the application connecting to Microsoft SQL Server. This value is a string up to a maximum of 128 characters. The value of this property may be useful for database administration purposes. This value is stored in the program_name column of the:
  • sys.sysprocesses table (Microsoft SQL Server 2005)
  • master.dbo.sysprocesses table (Microsoft SQL Server 2000)
Microsoft SQL Server 7 does not store this value
The default is an empty string.
QueryTimeout
{ positive integer | -1 | 0}. Sets the default query timeout (in seconds) for all statements created by a connection.
If set to a positive integer, the driver uses the value as the default timeout for any statement created by the connection. To override the default timeout value set by this connection option, call the Statement.setQueryTimeout() method to set a timeout value for a particular statement.
If set to -1, the query timeout functionality is disabled. The driver silently ignores calls to the Statement.setQueryTimeout() method.
If set to 0 (the default), the default query timeout is infinite (the query does not time out).
ReceiveStringParameterType
{NVARCHAR | VARCHAR | DESCRIBE}. Specifies how the driver describes String stored procedure output parameters to the database.
If set to NVARCHAR (the default), the driver describes String stored procedure output parameters as nvarchar (4000). Use this value if all output parameters returned by the connection are nchar or nvarchar. If the output parameter is char or varchar, the driver returns the output parameter value, but the returned value is limited to 4000 characters.
If set to VARCHAR, the driver describes String stored procedure output parameters as varchar (8000). Use this value if all output parameters returned by the connection are char or varchar. If the output parameter is nchar or nvarchar, data may not be returned correctly. This can occur when the returned data uses a code page other than the database default code page.
If set to DESCRIBE, the driver submits a request to the database to describe the parameters of the stored procedure. The driver uses the parameter data types returned by the driver to determine whether to describe the String output parameters as nvarchar or varchar. Use this value if there is a combination of nvarchar and varchar output parameters and if the varchar output parameters can return values that are greater than 4000 characters. This method always works, but it incurs the expense of having to describe the output parameters.
The default is NVARCHAR
ResultSetMetaDataOptions
{0 | 1}. The SQL Server driver can return table name information in the ResultSet metadata for Select statements if your application requires that information.
If set to 0 (the default) and the ResultSetMetaData.getTableName() method is called, the driver does not perform additional processing to determine the correct table name for each column in the result set. In this case, the getTableName() method may return an empty string for each column in the result set.
If set to 1 and the ResultSetMetaData.getTableName() method is called, the driver performs additional processing to determine the correct table name for each column in the result set. The driver also can return schema name and catalog name information when the ResultSetMetaData.getSchemaName() and ResultSetMetaData.getCatalogName() methods are called if the driver can determine that information.
See ResultSet MetaData Support for more information about returning ResultSet metadata.
The default is 0.
SelectMethod
OPTIONAL
{direct | cursor}. 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.
  • If set to direct (the default), the database server sends the complete result set in a single response to the driver when responding to a query. A server-side database cursor is not created if the requested result set type is a forward-only result set.Typically, responses are not cached by the driver. Using this method, the driver must process the entire response to a query before another query is submitted. If another query is submitted (using a different statement on the same connection, for example), the driver caches the response to the first query before submitting the second query. Typically, the Direct method performs better than the Cursor method.
  • If set to cursor, a server-side cursor is requested. When returning forward-only result sets, the rows are retrieved from the server in blocks. ThesetFetchSize() method can be used to control the number of rows that are retrieved for each request when forward-only result sets are returned. Performance tests show that, when returning forward-only result sets, the value ofStatement.setFetchSize() significantly impacts performance. There is no simple rule for determining thesetFetchSize() value that you should use. Oracle recommends that you experiment with different setFetchSize() values to determine which value gives the best performance for your application. The cursor method is useful for queries that produce a large amount of data, particularly if multiple open result sets are used.
See Performance Considerations for information about configuring this property for optimal performance.
The default is Direct.
SendStringParametersAsUnicode
OPTIONAL
{true | false}. Determines whether string parameters are sent to the Microsoft SQL Server database in Unicode or in the default character encoding of the database.
If set to true (the default), string parameters are sent to Microsoft SQL Server in Unicode.
If set to false, the driver sends string parameters to the database in the default character encoding of the database, which can improve performance because the server does not need to convert Unicode characters to the default encoding.
If a value is specified for the CodePageOverride property and this property is set to true, this property is ignored and a warning is generated.
See Performance Considerations for information about configuring this property for optimal performance.
The default is true.
ServerName
REQUIRED
Specifies either the IP address in IPv4 or IPv6 format, or the server name (if your network supports named servers) of the primary database server or named instance. For example, 122.23.15.12 or SQLServerServer.
To connect to a named instance, specify server_name\\ instance_name for this property, where server_name is the IP address and instance_name is the name of the instance to which you want to connect on the specified server.
This property is supported only for data source connections.
See Connecting to Named Instances for more information about connecting to named instances.
SnapshotSerializable
{true | false}. For Microsoft SQL Server 2005 only. Allows your application to use Snapshot Isolation for connections.
To configure Snapshot Isolation for connections, you must have your Microsoft SQL Server 2005 database configured for Snapshot Isolation, your application must have the transaction isolation level set to Serializable, and this property must be set to true.
If set to false (the default) and your application has the transaction isolation level set to Serializable, the application uses the Serializable isolation level.
This property is useful for applications that have the Serializable isolation level set. Using the SnapshotSerializable property in this case allows you to use Snapshot Isolation with no or minimum code changes. If you are developing a new application, you may find that using the constant TRANSACTION_SNAPSHOT is a better choice. See Isolation Levels for details.
See Performance Considerations for information about configuring this property for optimal performance.
The default is false.
TransactionMode
{implicit | explicit}. Controls how the driver delimits the start of a local transaction.
If set to implicit, the driver uses implicit transaction mode. This means that Microsoft SQL Server, not the driver, automatically starts a transaction when a transactionable statement is executed. Typically, implicit transaction mode is more efficient than explicit transaction mode because the driver does not have to send commands to start a transaction and a transaction is not started until it is needed. When TRUNCATE TABLE statements are used with implicit transaction mode, Microsoft SQL Server may roll back the transaction if an error occurs. If this occurs, use the explicit value for this property.
If set to explicit, the driver uses explicit transaction mode. This means that the driver, not Microsoft SQL Server, starts a new transaction if the previous transaction was committed or rolled back.
The default is implicit.
TrustStore
Specifies the directory of the truststore file to be used when SSL server authentication is used. The truststore file contains a list of the Certificate Authorities (CAs) that the client trusts.
This value overrides the directory of the truststore file specified by the javax.net.ssl.trustStore Java system property. If this property is not specified, the truststore directory is specified by the javax.net.ssl.trustStore Java system property.
This property is ignored if ValidateServerCertificate=false.
TrustStorePassword
Specifies the password of the truststore file to be used when SSL server authentication is used. The truststore file contains a list of the Certificate Authorities (CAs) that the client trusts.
This value overrides the password of the truststore file specified by the javax.net.ssl.trustStorePassword Java system property. If this property is not specified, the truststore password is specified by the javax.net.ssl.trustStorePassword Java system property.
This property is ignored if ValidateServerCertificate=false.
User
The case-insensitive user name used to connect to your Microsoft SQL Server database. A user name is required only if SQL Server authentication is enabled on your database. If so, contact your system administrator to obtain your user name.
UseServerSideUpdatableCursors
{true | false}. Determines whether the driver uses server-side cursors when an updatable result set is requested.
If set to true, server-side updatable cursors are created when an updatable result set is requested.
If set to false, the default updatable result set functionality is used.
See Server-Side Updatable Cursors for more information about using server-side updatable cursors.
See Performance Considerations for information about configuring this property for optimal performance.
The default is false.
ValidateServerCertificate
{true | false}. Determines whether the driver validates the certificate sent by the database server when SSL encryption is enabled ( EncryptionMethod=SSL). When using SSL server authentication, any certificate sent by the server must be issued by a trusted Certificate Authority (CA). Allowing the driver to trust any certificate returned from the server even if the issuer is not a trusted CA is useful in test environments because it eliminates the need to specify truststore information on each client in the test environment.
If set to false (the default), the driver does not validate the certificate sent by the database server. The driver ignores any truststore information specified by the TrustStore and TrustStorePassword properties or Java system properties.
If set to true, the driver validates the certificate sent by the database server. Any certificate from the server must be issued by a trusted CA in the truststore file. if the HostNameInCertificate property is specified, the driver also validates the certificate using a host name. The HostNameInCertificate property is optional and provides additional security against man-in-the-middle (MITM) attacks by ensuring that the server the driver is connecting to is the server that was requested.
Truststore information is specified using the TrustStore and TrustStorePassword properties or by using Java system properties.
See Data Encryption for information about configuring for authentication.
WSID
OPTIONAL
The workstation ID, which typically is the network name of the computer on which the application resides. The value is a string up to a maximum of 128 characters. The value of this property may be useful for database administration purposes and can be returned by sp_who and the Transact-SQL HOST_NAME function. This value is stored in the hostname column of the:
  • sys.sysprocesses table (Microsoft SQL Server 2005)
  • master.dbo.sysprocesses table (Microsoft SQL Server 2000)
Microsoft SQL Server 7 does not store this value.
The default is an empty string.
XATransactionGroup
OPTIONAL
The transaction group ID that identifies any transactions initiated by the connection. This ID can be used for distributed transaction cleanup purposes.
You can use the XAResource.recover method to roll back any transactions left in an unprepared state. When you call XAResource.recover, any unprepared transactions that match the ID on the connection used to call XAResource.recover are rolled back. For example, if you specify XATransactionGroup=ACCT200 and call XAResource.recover on the same connection, any transactions left in an unprepared state identified by the transaction group ID of ACCT200 are rolled back.
See Distributed Transaction Cleanup for more information about distributed transaction cleanup.
XMLDescribeType
{longvarchar | longvarbinary}. Determines whether the driver maps XML data to the LONGVARCHAR or LONGVARBINARY data type.
If set to longvarchar (the default), the driver maps XML data to the LONGVARCHAR data type.
If set to longvarbinary, the driver maps XML data to the LONGVARBINARY data type.
See Returning and Inserting/Updating XML Data for more information.
The default is longvarchar.
解决方案:[Microsoft][SQL Server 2000 Driver for JDBC][SQLServer]用户 'sa' 登录失败 屡次遇到的问题不得不记下一笔,教训啊,耽误了不少时间。问题描述         用java语言写一个连接数据库SQL Server2000的代码;如下import java.sql.*; public class ToSql2000 {public static void main(String[] srg) {   String driverName = "com.micro 阅读详情

相关推荐

如何连接Java到SQLServer - JDBC Driver 的 Microsoft Windows 版本安装说明

首先要了解:连接JDBC这件事,和那些软件或包的版本有关? 与编译器无关。采用任何版本的Eclipse,IDea都不影响; 与Java版本无关。 这款JDBC-Driver通过 Java Platform Enterprise Edition 中可用的标准 JDBC 应用程序编程接口 (API) 提供数据库连接。内置了两个不同的jar文件以解决更老版本的Java驱动问题。 与SQL Se...

Quaint_Senator的博客 1238

NoClassDefFoundError: com/teradata/jdbc/jdk6/JDK6_SQL_ResultSetMetaData解决办法

环境: TD:Teradata15.00.02.08 CDH:CDH5.13.0 20/07/16 05:16:15 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6-cdh5.13.0 20/07/16 05:16:15 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead. 20/07/16 05:

小海的专栏 805

Microsoft JDBC Driver XX (XX表示版本号)for SQL Server的安装

使用eclipse与server sql 时,需要下载微软的jdbc 驱动连接,(重点来了)唯一需要注意的是Microsoft JDBC Driver XX (XX表示版本号)for SQL Server驱动的版本支持的java中jre的版本与SQL Server的版本(我为什么会强调这个问题呢?因为网上有很多有关的教程,但是都没有提到这一点。也因为此,当我想要用到java编写数据库连接的程序时,...

GUIDchen的博客 4162

微软对SqlServer的jdbc连接参数详解:

jdbc;SqlServer

中年人 1435

SQL Server 2008 安装与 Java JDBC 连接实战:从环境搭建到排错指南

JDBC(Java Database Connectivity)是 Java 语言中用于连接和操作数据库的标准 API,它定义了一套通用的接口,允许开发者通过统一的编程方式访问不同类型的关系型数据库。其核心原理在于通过数据库厂商提供的驱动程序(Driver)作为桥梁,将 Java 应用程序的 SQL 请求转换为特定数据库能理解的协议,从而实现数据的增删改查。这项技术的价值在于实现了 Java 应用与数据库的解耦,提升了应用的可移植性和可维护性。在实际的工程实践中,无论是构建企业级应用还是进行数据分析,可靠的

迷彩风情 358

antdv-<a-form>的使用

是 Ant Design Vue 中用于创建表单的组件,提供了一种结构化的方式来收集用户输入。它支持多种布局、验证、数据绑定等功能,非常适合用于处理用户输入和提交数据。

2302_81312344的博客 2625

Cpp 调用sql server 存储过程时不返回output参数解决办法

Cpp 调用sql server 存储过程时不返回output参数,但是在ssms中调用的时候能正常返回,貌似数据库和应用代码是一切正常,再测试用c#调用也能正常获取output参数,在存储过程的的开始加上set nocount on,就能解决这个问题。

766

Tartancalib标定OAK-FFC_4p(上)

1.使用Tartancalib标定双目或多目相机前,先对单个相机标定获得内参,再获得外参。

qq_51731421的博客 1286

在JSP中使用 Microsoft JDBC Driver 连接SQL Server2000

本来这个问题是老问题了,但是,查了网上的中文资料,实在是...,要么是讲得不清楚,要不就是环节有问题,CSDN论坛中细细翻阅FAQ中讲得只是JSP代码连接SQL Server,及略带讲述必须安装Microsoft JDBC驱动,只好细细翻阅CSDN论坛贴子,并亲自操刀实践了多次,现总结如下: 情况比想象中的要坏得多:调了一个多小时,终于连接到SQL Server2000,很恼火啊,呵呵!1. 安装

Chenxinyi's Weblog 7245

安装anaconda3时出现错误:Failed to link extracted packages to D:\anaconda!...如何解决?

🏆本文收录于 《全栈 Bug 调优(实战版)》 专栏。专栏聚焦真实项目中的各类疑难 Bug,从成因剖析 → 排查路径 → 解决方案 → 预防优化全链路拆解,形成一套可复用、可沉淀的实战知识体系。无论你是初入职场的开发者,还是负责复杂项目的资深工程师,都可以在这里构建一套属于自己的「问题诊断与性能调优」方法论,助你稳步进阶、放大技术价值 。

**My Coding Family** 1496

【图论】系列(七)图论的中心性度量方法及重要性评价指标

图论中的中心性度量方法是用来衡量图中各个节点(或顶点)相对重要性的指标。

qq_30066733的博客 1085

SQL Server 2008 R2与JDBC连接

配置Eclipse通过JDBC连接访问SQL Server 2008 R2 鄙人在CSDN上搜到的唯一能成功运行的讲解了,转载以下。 配置连接大体分为三步: 一、SQL Server 2008 R2的配置 二、Microsoft JDBC Driver for SQL Server(JDBC驱动包)的下载与导入 三、在Eclipse中写代码测试是否连接成功 在连接数据库之前必须保证SQL Server 2008 R2的验证方式是SQL Server身份验证,如是,则略过这段直接看Eclipse连接数据库的具

taylorswift的博客 3449

算法 | 基于灰狼优化算法的无人机三维路径规划方法研究(附matlab代码)

针对复杂环境下的无人机三维路径规划问题,本文提出一种基于灰狼优化算法(Grey Wolf Optimizer, GWO)的解决方案。通过模拟灰狼群体的社会等级与协作捕猎机制,结合动态参数调整策略,优化路径长度与避障性能。实验表明,相较于粒子群优化(PSO)和遗传算法(GA),GWO算法在收敛速度与路径成本上分别提升约25%和18%,且在三维城市地形中表现出更强的避障鲁棒性。本文提供完整的MATLAB代码实现,为无人机自主导航提供理论与技术支撑。

尘世冰封的专栏 297

JDBC连接sql server数据库的详细步骤和代码

JDBC连接sql server数据库的步骤如下: 1、加载JDBC驱动程序: 在连接数据库之前,首先要加载想要连接的数据库的驱动到JVM(Java虚拟机), 这通过java.lang.Class类的静态方法forName(String className)实现。 成功加载后,会将Driver类的实例注册到DriverManager类中。 2、提供JD

續寫經典 4万+

手把手教你学Simulink--基于多能源系统协同控制的复杂场景实例:氢燃料电池+锂电池混合动力电动汽车能量管理仿真

本文介绍了基于Simulink的氢燃料电池与锂电池混合动力电动汽车能量管理系统的建模与仿真方法。系统包含驾驶循环输入、燃料电池子系统、锂电池子系统、能量管理、电机驱动等模块,通过协同控制优化能源分配。详细说明了从模型创建到各子系统设置的7个步骤,并提供了MATLAB代码示例。该仿真可评估不同工况下的系统响应速度、能量利用效率和电池寿命等性能指标,为混合动力汽车的能量管理策略设计和优化提供参考。

MHD0815的博客 242

第10集:AIOps 平台架构设计!画出面试官最想看的系统全景图

本文介绍了如何将AIOps平台的六大功能模块整合为四层架构设计,并生成专业系统全景图。文章首先指出面试中架构设计能力的重要性,强调一张清晰的架构图能直观展现全局观。随后指导读者检查项目结构,准备绘图环境。核心部分详细拆解了四层架构:数据采集层(Prometheus、ELK等)、AI分析层(巡检、告警、预测等)、决策执行层(工作流引擎、自愈Agent)和展示交互层(API、控制台)。通过Python代码自动生成模块依赖关系图,并提供了面试讲解技巧。全文旨在帮助开发者在面试中系统性地展示项目架构设计能力。

qq_2937655951的博客 104

终极指南:5分钟快速上手Microsoft JDBC Driver连接SQL Server

Microsoft JDBC Driver for SQL Server是一个高性能的Type 4 JDBC驱动程序,为Java应用程序提供与SQL Server和Azure SQL Database的无缝连接。无论你是Java开发者、企业应用架构师,还是云端部署专家,这个驱动都能让你的数据库操作变得简单高效!🎯 ## 为什么选择Microsoft JDBC Driver? 选择Micros

gitblog_01150的博客 1161

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

DataGrip驱动程序之SQL Server JDBC 驱动程序【DataGrip无法下载SQLServer驱动问题】

本文介绍了在DataGrip中配置SQL Server JDBC驱动程序的完整步骤:1.从Microsoft官网下载JDBC驱动压缩包;2.解压到DataGrip安装目录下的plugins文件夹;3.在DataGrip的数据源属性中添加驱动程序文件路径,选择解压后的jar包;4.输入数据库连接信息测试连通性。整个过程详细说明了驱动下载、路径配置和连接测试的每个环节,帮助用户顺利完成SQL Server数据库在DataGrip中的连接配置。

TechExplorer365的博客 1799

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

java 通过jdbc连接sql server数据库的常见问题

<p class="MsoNormal" align="left" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:left;line-height:150%;mso-pagination:widow-orphan"><span style="font-size:9.0pt;line-height:150

JonnyWei的专栏 3179

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

SQL Server 2005 JDBC Driver 配置

Perface在浏览本文之前必须按照本Blog的《SQL Server 2005 常用配置》一文进行基本的配置,本文不会重复引述其内容。详细请参考以下link:http://blog.csdn.net/killercentury/archive/2008/04/24/2319545.aspxIntroduction本文主要讲述怎么在Windows XP上配置好Microsoft S

killercentury的专栏 5010

jdbc连接SQLServer2005出现 NO suitable driver问题的一个原因

今天用Eclipse 写了一个程序连接SQServer2005,从网上下了一个驱动程序加载后,运行程序是报错,说找不到suitable Driver,以下是原代码:import java.sql.*;class TestJDBC { public static void main(String[] args) throws Exception{  //Class.forName("co

炒饭的专栏 1330

使用JDBC连接SQL Server数据库

准备工作 Myeclipse10 Mircosoft SQL Server 2016(必须使用SQL server 身份验证,若没有的话请参考这篇文章) jdk1.7或者jdk1.8(使用Myeclipse10中自带的jdk也可以。安装jdk1.7可以参考这篇文章) 具体操作 获得SQL server的驱动包。官网下载链接点这里 选择对应的版本,一般来说,现在Myeclipse10中最高支持...

阳光派Plus的博客 9566

Java连接SQL Server教程(详细教程)

总结不易,希望uu们不要吝啬你们的??哟(^U^)ノ~YO!!如有问题,欢迎评论区批评指正??

m0_74824170的博客 5618
上一篇: 1. MySQL连接超时&连接参数
下一篇: rpm笔记
shersfy
博客等级 码龄17年 4粉丝 25原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值