Downloads:

11,304

Downloads of v 9.4.0.0:

191

Last Update:

06 Aug 2021

Package Maintainer(s):

Software Author(s):

  • Microsoft

Tags:

sql sql-server java jdbc microsoft

Microsoft JDBC Driver for SQL Server

  • 1
  • 2
  • 3

9.4.0.0 | Updated: 06 Aug 2021

Downloads:

11,304

Downloads of v 9.4.0.0:

191

Maintainer(s):

Software Author(s):

  • Microsoft

  • 1
  • 2
  • 3
Microsoft JDBC Driver for SQL Server 9.4.0.0

  • 1
  • 2
  • 3

All Checks are Passing

3 Passing Tests


Validation Testing Passed


Verification Testing Passed

Details

Scan Testing Successful:

No detections found in any package files

Details

Deployment Method: Individual Install, Upgrade, & Uninstall

To install Microsoft JDBC Driver for SQL Server, run the following command from the command line or from PowerShell:

>

To upgrade Microsoft JDBC Driver for SQL Server, run the following command from the command line or from PowerShell:

>

To uninstall Microsoft JDBC Driver for SQL Server, run the following command from the command line or from PowerShell:

>

Deployment Method:

📝 NOTE: This applies to both open source and commercial editions of Chocolatey.

1. Enter Your Internal Repository Url

(this should look similar to https://community.chocolatey.org/api/v2/)


2. Setup Your Environment

1. Ensure you are set for organizational deployment

Please see the organizational deployment guide

2. Get the package into your environment

  • Open Source or Commercial:
    • Proxy Repository - Create a proxy nuget repository on Nexus, Artifactory Pro, or a proxy Chocolatey repository on ProGet. Point your upstream to https://community.chocolatey.org/api/v2/. Packages cache on first access automatically. Make sure your choco clients are using your proxy repository as a source and NOT the default community repository. See source command for more information.
    • You can also just download the package and push it to a repository Download

3. Copy Your Script

choco upgrade sqljdbc -y --source="'INTERNAL REPO URL'" [other options]

See options you can pass to upgrade.

See best practices for scripting.

Add this to a PowerShell script or use a Batch script with tools and in places where you are calling directly to Chocolatey. If you are integrating, keep in mind enhanced exit codes.

If you do use a PowerShell script, use the following to ensure bad exit codes are shown as failures:


choco upgrade sqljdbc -y --source="'INTERNAL REPO URL'" 
$exitCode = $LASTEXITCODE

Write-Verbose "Exit code was $exitCode"
$validExitCodes = @(0, 1605, 1614, 1641, 3010)
if ($validExitCodes -contains $exitCode) {
  Exit 0
}

Exit $exitCode

- name: Install sqljdbc
  win_chocolatey:
    name: sqljdbc
    version: '9.4.0.0'
    source: INTERNAL REPO URL
    state: present

See docs at https://docs.ansible.com/ansible/latest/modules/win_chocolatey_module.html.


chocolatey_package 'sqljdbc' do
  action    :install
  source   'INTERNAL REPO URL'
  version  '9.4.0.0'
end

See docs at https://docs.chef.io/resource_chocolatey_package.html.


cChocoPackageInstaller sqljdbc
{
    Name     = "sqljdbc"
    Version  = "9.4.0.0"
    Source   = "INTERNAL REPO URL"
}

Requires cChoco DSC Resource. See docs at https://github.com/chocolatey/cChoco.


package { 'sqljdbc':
  ensure   => '9.4.0.0',
  provider => 'chocolatey',
  source   => 'INTERNAL REPO URL',
}

Requires Puppet Chocolatey Provider module. See docs at https://forge.puppet.com/puppetlabs/chocolatey.


4. If applicable - Chocolatey configuration/installation

See infrastructure management matrix for Chocolatey configuration elements and examples.

This package was approved as a trusted package on 06 Aug 2021.

Description

Java Database Connectivity (JDBC) driver for use with SQL Server, and Azure SQL Database. The driver is available at no
extra charge and provides Java database connectivity from any Java application, application server, or Java-enabled
applet. This driver is a Type 4 JDBC driver that provides database connectivity through the standard JDBC application
program interfaces (APIs).

The Microsoft JDBC Driver for SQL Server has been tested against major application servers such as IBM WebSphere, and
SAP NetWeaver.

Package Parameters

The Languages package parameter can be set to install the package with the specified language. If no language is
specified the install will default to English.

Multiple languages can be installed by providing a comma-separated list of language codes.

  • /Languages=[language-codes] - installs the package using the specified languages. The languages must be supplied
    as a comma-separated listSupported languages are:
Language Code Mapping Parameters
Brazilian (Portuguese) br ptb --params "/Languages=br"
German de deu --params "/Languages=de"
English en enu --params "/Languages=en"
Spanish es esn --params "/Languages=es"
French fr fra --params "/Languages=fr"
Italian it ita --params "/Languages=it"
Japanese ja jpn --params "/Languages=ja"
Korean ko kor --params "/Languages=ko"
Russian ru rus --params "/Languages=ru"
Chinese (Simplified) zh chs --params "/Languages=zh"
Chinese (Simplified) zh-CN chs --params "/Languages=zh-CN"
Chinese (Traditional) zh-TW cht --params "/Languages=zh-TW"

For example: choco install sqljdbc --params "/Languages=en,fr" to install the English and French versions of the driver

  • /InstallDir - sets the directory in which to install sqljdbc. The installation defaults to the system
    directory [Environment]::GetFolderPath('ProgramFiles')\Microsoft JDBC DRIVER for SQL Server
  • /User - override the default installation directory and install the driver in the user directory
    [Environment]::GetFolderPath('Programs')\Microsoft JDBC DRIVER for SQL Server

To have Chocolatey remember parameters on upgrade, be sure to set choco feature enable -n=useRememberedArgumentsForUpgrades.

Notes

  • The drivers will be installed under [InstallDir]\sqljdbc_X.Y\[LanguageMaping] where X.Y represents the
    Major.Minor versions of the package and LanguageMapping is the sub directory representing the mapping for
    the default (English - enu) or other specified languages
  • This package is automatically updated using the Chocolatey Automatic Package Update Model (AU).
    If you find it is out of date by more than a day or two, please contact the maintainer(s) and let them know the package is no longer updating correctly.

tools\chocolateyInstall.ps1
$ErrorActionPreference = 'Stop'

add-type @"
public struct Language {
   public string Name;
   public string Mapping;
   public string Checksum;
}
"@

$languageDefinitions =  @{
    'br'    = [Language] @{ Name = 'Brazilian (Portuguese)'; Mapping = 'ptb'; Checksum = '4eee335e8e8da993a0cca04a432e0dc2c407172382dcb9da98fe2a7ca776a1b6' }
    'de'    = [Language] @{ Name = 'German';                 Mapping = 'deu'; Checksum = 'c7a421e584fa7c63325dcad5a56133a1dad39c47ba752a23378afb22b73bab59' }
    'en'    = [Language] @{ Name = 'English';                Mapping = 'enu'; Checksum = 'd6866b9ff8586f953c462a27ecd208c9d6978570e7022dc7aab957f5cc70a5a8' }
    'es'    = [Language] @{ Name = 'Spanish';                Mapping = 'esn'; Checksum = 'de1a9b81cb700b87b4725fbe4ab6bc82cb602567cb664c76b735bf46f4af82af' }
    'fr'    = [Language] @{ Name = 'French';                 Mapping = 'fra'; Checksum = '4872d7e0f393db76515873456638200eb15026a51ff62089e1eb10a410821fc8' }
    'it'    = [Language] @{ Name = 'Italian';                Mapping = 'ita'; Checksum = '5bca4a9d3ae2fe83fb835dece2be0f0416afd8408d4787cca2b0efbc62020998' }
    'ja'    = [Language] @{ Name = 'Japanese';               Mapping = 'jpn'; Checksum = '4f4db6f721080c52d2a3698475bf806c4be8ae9b51b5cc0e8ca28054c88c1fd0' }
    'ko'    = [Language] @{ Name = 'Korean';                 Mapping = 'kor'; Checksum = 'e85e6ed3e4c876f128d393fa39750e74665126d04bb5d36f64f718cad86a15d0' }
    'ru'    = [Language] @{ Name = 'Russian';                Mapping = 'rus'; Checksum = 'ac21d5cdd8129ea87568cd7f2fff78597e363812f36ce29f883ceb888ce3debd' }
    'zh'    = [Language] @{ Name = 'Chinese';                Mapping = 'chs'; Checksum = 'fc4eaad08e65d0e0fc4228fc849a07fb04359662701dcf8e71788b83dd5eaf86' }
    'zh-CN' = [Language] @{ Name = 'Chinese (Simplified)';   Mapping = 'chs'; Checksum = 'fc4eaad08e65d0e0fc4228fc849a07fb04359662701dcf8e71788b83dd5eaf86' }
    'zh-TW' = [Language] @{ Name = 'Chinese (Traditional)';  Mapping = 'cht'; Checksum = '25089b474c281a762b1b2b68f092caee141df0edf5a59de257ee44949c72af1a' }
}

$base = 'https://download.microsoft.com/download/b/c/5/bc5e407f-97ff-42ea-959d-12f2391063d7'

$pp = Get-PackageParameters

if ($pp.InstallDir) {
    $installDir = $pp.InstallDir
} else {
    if ($pp.User) {
        $programs = [Environment]::GetFolderPath('LocalApplicationData')
    } else {
        $programs = [Environment]::GetFolderPath('ProgramFiles')
    }

    $installDir = Join-Path $programs 'Microsoft JDBC DRIVER for SQL Server'
}

# check the languages parameter and default to 'en' if not supplied
$languages = $pp['Languages']

if ($null -eq $languages -or $languages -eq '') {
  $languages = 'en'
}

$reLang = “(?i)^(br|de|en|es|fr|it|ja|ko|ru|zh|zh-CN|zh-TW)$”

foreach ($language in $languages -split ',') {
  if ($language -notmatch $reLang) {
    Write-Error "Unsupported language $($language)"
  }
  
  $fileName = 'sqljdbc_{0}_{1}.zip' -f $Env:PackageVersion, $languageDefinitions[$language].Mapping

  $packageArgs = @{
    PackageName   = $env:ChocolateyPackageName
    UnzipLocation = $installDir
    Url           = "${base}/${fileName}"
    Checksum      = $languageDefinitions[$language].Checksum
    ChecksumType  = 'sha256'
  }
  
  Install-ChocolateyZipPackage @packageArgs  
}
tools\chocolateyUninstall.ps1
$ErrorActionPreference = 'Stop'

Get-ChildItem $env:chocolateyPackageFolder\* -include sqljdbc*.Install.txt, sqljdbc*.txt | Foreach-Object {
    $zipContentFile += Get-Content $_.fullname 
  }

if (($null -ne $zipContentFile) -and ($zipContentFile.Length -ge 1)) {
  $zipTargetFile = $zipContentFIle[0]
}

if (Test-Path -Path $zipTargetFile) {
  $unzipDirectory  = Split-Path $zipTargetFile 
  $parentDirectory = Split-Path $unzipDirectory
}

Uninstall-ChocolateyZipPackage 'sqljdbc' 'sqljdbc_9.4.0.0_*.zip'

# Uninstall-ChocolateyZipPackage only removes child directories unpacked from
# the archive so remove the main and parent directories if empty
if ((Get-ChildItem $unzipDirectory | Measure-Object).Count -eq 0) {
  Remove-Item $unzipDirectory -ErrorAction SilentlyContinue -Force | Out-Null
}

if ((Get-ChildItem $parentDirectory | Measure-Object).Count -eq 0) {
  Remove-Item $parentDirectory -ErrorAction SilentlyContinue -Force | Out-Null    
}

Log in or click on link to see number of positives.

In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).

Chocolatey Pro provides runtime protection from possible malware.

Add to Builder Version Downloads Last Updated Status
Microsoft JDBC Driver for SQL Server 9.2.1.0 134 Monday, June 7, 2021 Approved
Microsoft JDBC Driver for SQL Server 7.0.0.0 5772 Friday, August 24, 2018 Approved
Microsoft JDBC Driver for SQL Server 6.2.2.0 1271 Thursday, February 8, 2018 Approved
Microsoft JDBC Driver for SQL Server 6.0.8112.100 2154 Friday, January 27, 2017 Approved
Microsoft JDBC Driver for SQL Server 4.0.2206.100 1782 Tuesday, May 7, 2013 Approved

This package has no dependencies.

Discussion for the Microsoft JDBC Driver for SQL Server Package

Ground Rules:

  • This discussion is only about Microsoft JDBC Driver for SQL Server and the Microsoft JDBC Driver for SQL Server package. If you have feedback for Chocolatey, please contact the Google Group.
  • This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
  • The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
  • Tell us what you love about the package or Microsoft JDBC Driver for SQL Server, or tell us what needs improvement.
  • Share your experiences with the package, or extra configuration or gotchas that you've found.
  • If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.
comments powered by Disqus