Skip to content

Commit

Permalink
updated ReadMe file, also uploads driver source code and build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangyushawn committed Nov 9, 2016
1 parent 72b4008 commit cfba660
Show file tree
Hide file tree
Showing 137 changed files with 66,179 additions and 236 deletions.
14 changes: 14 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Copyright(c) 2016 Microsoft Corporation
All rights reserved.

MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"),
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
1 change: 1 addition & 0 deletions META-INF/services/java.sql.Driver
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.microsoft.sqlserver.jdbc.SQLServerDriver
82 changes: 49 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,75 @@

Welcome to the Microsoft JDBC Driver for SQL Server project!

The Microsoft JDBC Driver for SQL Server is a Type 4 JDBC driver that provides database connectivity with SQL Server through the standard JDBC application program interfaces (APIs).
The Microsoft JDBC Driver for SQL Server is a Type 4 JDBC driver that provides database connectivity through the standard JDBC application program interfaces (APIs) available in the Java Platform, Enterprise Editions. The Driver provides access to Microsoft SQL Server and Azure SQL Database from any Java application, application server, or Java-enabled applet.

We hope you enjoy using the Microsoft JDBC Driver for SQL Server.

SQL Server Team

## Documentation
This driver is documented on [Microsoft's Documentation web site](https://msdn.microsoft.com/en-us/library/mt720657).


## Changes
For details about the changes included in this release, please see our [blog](https://msdn.microsoft.com/en-us/library/aa342325).

## Announcements
What's coming next? We will look into adding a more comprehensive set of tests, improving our javadocs, and start developing the next set of features.

## Known Issues
Please visit the project on GitHub to view outstanding issues.
## Build
### Prerequisites
* Java 8
* [Ant](http://ant.apache.org/manual/install.html) (with [Ivy](https://ant.apache.org/ivy/download.cgi)) or [Maven](http://maven.apache.org/download.cgi)
* An instance of SQL Server or Azure SQL Database that you can connect to.

### Build the JAR files
The build automatically triggers a set of verification tests to run. For these tests to pass, you will first need to modify the serverConfig.cfg file under .\src\test to provide the correct connection properties for your SQL Server or Azure SQL Database instance.

## Build
To build the jar files, you can use either Ant (with Ivy) or Maven.
To build the jar files, you must use Java 8 with either Ant (with Ivy) or Maven. You can choose to build a JDBC 4.1 compliant jar file (for use with JRE 7) and/or a JDBC 4.2 compliant jar file (for use with JRE 8).

* Ant:
* Run `ant`. This creates both JDBC 4.1 compliant jar and JDBC 4.2 compliant jar in \build directory
* Run `ant build41`. This creates JDBC 4.1 compliant jar in \build directory
* Run `ant build42`. This creates JDBC 4.2 compliant jar in \build directory
1. If you have not already done so, update the serverConfig.cfg file under .\src\test with the connection properties for your SQL Server or SQL DB instance.
2. Run one of the commands below to build a JDBC 4.1 compliant jar, JDBC 4.2 compliant jar, or both in the \build directory.
* Run `ant`. This creates both JDBC 4.1 compliant jar and JDBC 4.2 compliant jar in \build directory
* Run `ant build41`. This creates JDBC 4.1 compliant jar in \build directory
* Run `ant build42`. This creates JDBC 4.2 compliant jar in \build directory

* Maven:
* Run `mvn install -Pbuild41`. This creates JDBC 41 compliant jar in \target directory
* Run `mvn install -Pbuild42`. This creates JDBC 42 compliant jar in \target directory
1. If you have not already done so, update the serverConfig.cfg file under .\src\test with the connection properties for your SQL Server or SQL DB instance.
2. Run one of the commands below to build a JDBC 4.1 compliant jar or JDBC 4.2 compliant jar in the \build directory.
* Run `mvn install -Pbuild41`. This creates JDBC 4.1 compliant jar in \target directory
* Run `mvn install -Pbuild42`. This creates JDBC 4.2 compliant jar in \target directory


## Resources

### Documentation
This driver is documented on [Microsoft's Documentation web site](https://msdn.microsoft.com/en-us/library/mt720657).

### Sample Code
For samples, please see the src\sample directory.

### Download the driver
Don't want to compile anything? The driver can be downloaded from the [Microsoft Download Center](https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774)


## Download the driver
The driver can be downloaded from the [Microsoft Download Center](https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774)
## Guidelines for Reporting Issues
We appreciate you taking the time to test the driver, provide feedback and report any issues. It would be extremely helpful if you:

- Report each issue as a new issue (but check first if it's already been reported)
- Try to be detailed in your report. Useful information for good bug reports include:
* What you are seeing and what the expected behaviour is
* Which jar file?
* Environment details: e.g. Java version, client operating system?
* Table schema (for some issues the data types make a big difference!)
* Any other relevant information you want to share
- Try to include a Java sample demonstrating the isolated problem.

## Notes
Supported operating systems for Microsoft JDBC Driver 6.0 for SQL Server include:
* Windows Server 2008 SP2
* Windows Server 2008 R2 SP1
* Windows Server 2012
* Windows Server 2012 R2
* Windows Vista SP2
* Windows 7 SP1
* Windows 8
* Windows 8.1
* Windows 10
* Linux
* Unix
Thank you!

The list above is an example of some of the supported operating systems. The JDBC driver is designed to work on any operating system that supports the use of a Java Virtual Machine (JVM). However, only Oracle Solaris (x86), SUSE Linux, and Windows Vista Service Pack 2 or later operating systems have been tested.
### Reporting security issues and security bugs
Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) [[email protected]](mailto:[email protected]). You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the [Security TechCenter](https://technet.microsoft.com/en-us/security/ff852094.aspx).


## License
The Microsoft JDBC Driver for SQL Server is licensed under the MIT license. See the LICENSE file for more details.
The Microsoft JDBC Driver for SQL Server is licensed under the MIT license. See the [LICENSE](https://github.com/Microsoft/mssql-jdbc/blob/master/LICENSE) file for more details.



## Code of conduct
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
157 changes: 157 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
<project name="sqljdbc" default="build" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<description>
----- Building sqljdbc Project -----
</description>
<!-- set global properties for this build -->
<property name="artifactId" value="mssql-jdbc"/>
<property name="version" value="6.1.0"/>

<property name="src" location="src/main/java"/>
<property name="build" location="build"/>
<property name="test" location="src/test/java"/>
<property name="bvtTest_Classes" location="${build}/classes/test/bvt"/>

<!-- download dependencies -->
<ivy:resolve>
<dependency org="com.microsoft.azure" name="azure-keyvault" rev="0.9.3"/>
<dependency org="junit" name="junit" rev="4.12"/>
</ivy:resolve>

<!-- retrieves all the dependencies of the resolve call to lib directory -->
<ivy:retrieve />

<target name="init" >
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
<mkdir dir="${build}/classes"/>
<mkdir dir="${bvtTest_Classes}"/>
</target>

<target name="compile" depends="init"
description="compile the source">
<mkdir dir="${CLASSES_DST_DIR}"/>
<javac srcdir="${src}"
destdir="${CLASSES_DST_DIR}"
fork="yes"
deprecation="on"
encoding="UTF-8"
source="${JAVA_VERSION}"
target="${JAVA_VERSION}"
debug="true"
debuglevel="${DEBUG_LEVEL}"
excludes="${EXCLUDE_STUBS}" >

<classpath>
<fileset dir="lib"/>
</classpath>

</javac>
</target>

<target name="build41" description="generate the distribution">
<antcall target="compile">
<param name="CLASSES_DST_DIR" value="${build}/classes/jdbc41"/>
<param name="JAVA_VERSION" value="1.7"/>
<param name="DEBUG_LEVEL" value="source,lines"/>
<param name="EXCLUDE_STUBS" value="com/microsoft/sqlserver/jdbc/SQLServerJdbc3.java, com/microsoft/sqlserver/jdbc/SQLServerJdbc4.java, com/microsoft/sqlserver/jdbc/SQLServerJdbc42.java"/>
</antcall>
<jar destfile="${build}/${artifactId}-${version}.jre7.jar">
<manifest>
<attribute name="Title" value="Microsoft JDBC Driver ${version} for SQL Server"/>
<attribute name="Version" value="${version}"/>
<attribute name="Vendor" value="Microsoft Corporation"/>
</manifest>
<fileset dir="${build}/classes/jdbc41"/>
<metainf dir="META-INF"/>
</jar>
<antcall target="Test41"/>
</target>

<target name="build42" description="generate the distribution">
<antcall target="compile">
<param name="CLASSES_DST_DIR" value="${build}/classes/jdbc42"/>
<param name="JAVA_VERSION" value="1.8"/>
<param name="DEBUG_LEVEL" value="source,lines"/>
<param name="EXCLUDE_STUBS" value="com/microsoft/sqlserver/jdbc/SQLServerJdbc3.java, com/microsoft/sqlserver/jdbc/SQLServerJdbc4.java, com/microsoft/sqlserver/jdbc/SQLServerJdbc41.java"/>
</antcall>
<jar destfile="${build}/${artifactId}-${version}.jre8.jar">
<manifest>
<attribute name="Title" value="Microsoft JDBC Driver ${version} for SQL Server"/>
<attribute name="Version" value="${version}"/>
<attribute name="Vendor" value="Microsoft Corporation"/>
</manifest>
<fileset dir="${build}/classes/jdbc42"/>
<metainf dir="META-INF"/>
</jar>
<antcall target="Test42"/>
</target>

<target name="build" description="generate the distribution">
<antcall target="clean"/>
<antcall target="build41"/>
<antcall target="build42"/>
</target>

<target name="compile_test"
description="compile the junit source">
<javac classpathref="${JDBC_VERSION}" srcdir="${test}"
destdir="${bvtTest_Classes}"
encoding="UTF-8"
source="${JAVA_VERSION}"
target="${JAVA_VERSION}"
description="compiling the junit source" >
</javac>
</target>

<target name="Test41" >
<antcall target="compile_test">
<param name="JAVA_VERSION" value="1.7"/>
<param name="JDBC_VERSION" value="test_classpath41"/>
</antcall>
<junit haltonfailure="true" printsummary="true" showoutput="true">
<formatter type="plain" usefile="false" />
<classpath><path refid="test_classpath41" /></classpath>
<test name="bvtTest"></test>
</junit>
</target>

<target name="Test42" >
<antcall target="compile_test">
<param name="JAVA_VERSION" value="1.8"/>
<param name="JDBC_VERSION" value="test_classpath42"/>
</antcall>
<junit haltonfailure="true" printsummary="true" showoutput="true">
<formatter type="plain" usefile="false" />
<classpath><path refid="test_classpath42" /></classpath>
<test name="bvtTest"></test>
</junit>
</target>

<path id="test_classpath41">
<path location="${build}">
<fileset dir="${build}" includes="${artifactId}-${version}.jre7.jar"></fileset>
</path>
<path location="lib">
<fileset dir="lib" includes="*.jar"></fileset>
</path>
<path location="${bvtTest_Classes}"></path>
</path>

<path id="test_classpath42">
<path location="${build}">
<fileset dir="${build}" includes="${artifactId}-${version}.jre8.jar"></fileset>
</path>
<path location="lib">
<fileset dir="lib" includes="*.jar"></fileset>
</path>
<path location="${bvtTest_Classes}"></path>
</path>

<target name="clean"
description="clean up">
<delete dir="${build}"/>
</target>

</project>
Loading

0 comments on commit cfba660

Please sign in to comment.