Skip to content

Commit 28c8ab8

Browse files
committed
Adding initial setup for mssql
1 parent fae15f8 commit 28c8ab8

File tree

5 files changed

+36
-38
lines changed

5 files changed

+36
-38
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# MySQL JDBC Driver for eXist-db
1+
# Microsoft MSSQL JDBC Driver for eXist-db
22

33
Loadable JDBC Driver for MySQL within eXist-db.
44

pom.xml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
</parent>
1313

1414
<groupId>org.exist-db</groupId>
15-
<artifactId>exist-mysql-jdbc-driver</artifactId>
16-
<version>8.0.29</version>
15+
<artifactId>exist-mssql-jdbc-driver</artifactId>
16+
<version>10.2.0.jre8</version>
1717

1818
<name>MySQL JDBC Driver</name>
1919
<description>MySQL JDBC Driver for eXist-db</description>
20-
<url>https://exist-db.org/exist-db/jdbc/mysql</url>
20+
<url>https://exist-db.org/exist-db/jdbc/mssql</url>
2121

2222
<organization>
2323
<name>eXist-db</name>
@@ -33,14 +33,14 @@
3333
</licenses>
3434

3535
<scm>
36-
<url>https://www.github.com/eXist-db/exist-mysql-jdbc-driver.git</url>
37-
<connection>scm:git:https://www.github.com/eXist-db/exist-mysql-jdbc-driver.git</connection>
38-
<developerConnection>scm:git:https://www.github.com/eXist-db/exist-mysql-jdbc-driver.git</developerConnection>
36+
<url>https://www.github.com/eXist-db/exist-mssql-jdbc-driver.git</url>
37+
<connection>scm:git:https://www.github.com/eXist-db/exist-mssql-jdbc-driver.git</connection>
38+
<developerConnection>scm:git:https://www.github.com/eXist-db/exist-mssql-jdbc-driver.git</developerConnection>
3939
</scm>
4040

4141
<issueManagement>
4242
<system>GitHub</system>
43-
<url>https://www.github.com/eXist-db/exist-mysql-jdbc-driver/issues</url>
43+
<url>https://www.github.com/eXist-db/exist-mssql-jdbc-driver/issues</url>
4444
</issueManagement>
4545

4646
<properties>
@@ -51,7 +51,7 @@
5151
<exist.version>6.0.1</exist.version>
5252

5353
<!-- used in the EXPath Package Descriptor -->
54-
<package-name>https://exist-db.org/exist-db/jdbc/mysql</package-name>
54+
<package-name>https://exist-db.org/exist-db/jdbc/mssql</package-name>
5555
</properties>
5656

5757
<dependencies>
@@ -60,10 +60,9 @@
6060
<artifactId>exist-core</artifactId>
6161
<version>${exist.version}</version>
6262
</dependency>
63-
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
6463
<dependency>
65-
<groupId>mysql</groupId>
66-
<artifactId>mysql-connector-java</artifactId>
64+
<groupId>com.microsoft.sqlserver</groupId>
65+
<artifactId>mssql-jdbc</artifactId>
6766
<version>${project.version}</version>
6867
</dependency>
6968

src/main/xar-resources/icon.png

-5.91 KB
Loading

src/main/xquery/mysql-module.xqm renamed to src/main/xquery/mssql-module.xqm

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,63 @@
11
xquery version "3.1";
22

33
(:~
4-
: A module for performing SQL queries against MySQL Databases, returning XML representations of the result sets.
4+
: A module for performing SQL queries against mssql Databases, returning XML representations of the result sets.
55
:)
6-
module namespace mysql = "https://exist-db.org/exist-db/ns/app/mysql";
6+
module namespace mssql = "https://exist-db.org/exist-db/ns/app/mssql";
77
import module namespace sql="http://exist-db.org/xquery/sql";
88

9-
declare variable $mysql:classpath := "com.mysql.cj.jdbc.Driver";
9+
declare variable $mssql:classpath := "com.microsoft.sqlserver.jdbc.SQLServerDriver";
1010

1111
(:~
12-
: Opens a connection to a MySQL Database
12+
: Opens a connection to a mssql Database
1313
: @param $url The JDBC connection URL
1414
: @return an xs:long representing the connection handle
1515
:)
16-
declare function mysql:get-connection($url as xs:string)
16+
declare function mssql:get-connection($url as xs:string)
1717
as xs:long?
1818
{
19-
sql:get-connection($mysql:classpath, $url)
19+
sql:get-connection($mssql:classpath, $url)
2020
};
2121

2222
(:~
23-
: Opens a connection to a MySQL Database
23+
: Opens a connection to a mssql Database
2424
: @param $url The JDBC connection URL
2525
: @param $properties The JDBC database connection properties in the form &lt;properties&gt;&lt;property name="" value=""/&gt;&lt;/properties&gt;
2626
: @return an xs:long representing the connection handle
2727
:)
28-
declare function mysql:get-connection($url as xs:string, $properties as element()?)
28+
declare function mssql:get-connection($url as xs:string, $properties as element()?)
2929
as xs:long?
3030
{
31-
sql:get-connection($mysql:classpath, $url, $properties)
31+
sql:get-connection($mssql:classpath, $url, $properties)
3232
};
3333

3434
(:~
35-
: Opens a connection to a MySQL Database
35+
: Opens a connection to a mssql Database
3636
: @param $url The JDBC connection URL
37-
: @param $username The MySQL database username
38-
: @param $password The MySQL database password
37+
: @param $username The mssql database username
38+
: @param $password The mssql database password
3939
: @return an xs:long representing the connection handle
4040
:)
41-
declare function mysql:get-connection($url as xs:string, $username as xs:string, $password as xs:string)
41+
declare function mssql:get-connection($url as xs:string, $username as xs:string, $password as xs:string)
4242
as xs:long?
4343
{
44-
sql:get-connection($mysql:classpath, $url, $username, $password)
44+
sql:get-connection($mssql:classpath, $url, $username, $password)
4545
};
4646

4747
(:~
48-
: Prepares a SQL statement against a MySQL db using the connection indicated by the connection handle.
48+
: Prepares a SQL statement against a mssql db using the connection indicated by the connection handle.
4949
: @param $handle The connection handle
5050
: @param $sql-statement The SQL statement
5151
: @return an xs:long representing the statement handle
5252
:)
53-
declare function mysql:prepare($handle as xs:long, $sql-statement as xs:string)
53+
declare function mssql:prepare($handle as xs:long, $sql-statement as xs:string)
5454
as xs:long?
5555
{
5656
sql:prepare($handle, $sql-statement)
5757
};
5858

5959
(:~
60-
: Executes a SQL statement against a MySQL database.
60+
: Executes a SQL statement against a mssql database.
6161
: @param $connection-handle The connection handle
6262
: @param $sql-statement The SQL statement
6363
: @param $make-node-from-column-name
@@ -66,7 +66,7 @@ as xs:long?
6666
: will be replaced by an underscore!)
6767
: @return the results
6868
:)
69-
declare function mysql:execute(
69+
declare function mssql:execute(
7070
$connection-handle as xs:long,
7171
$sql-statement as xs:string,
7272
$make-node-from-column-name as xs:boolean
@@ -77,7 +77,7 @@ as element()?
7777
};
7878

7979
(:~
80-
: Executes a prepared SQL statement against a MySQL database.
80+
: Executes a prepared SQL statement against a mssql database.
8181
: @param $connection-handle The connection handle
8282
: @param $statement-handle The prepared statement handle
8383
: @param $parameters Parameters for the prepared statement.
@@ -94,7 +94,7 @@ as element()?
9494
: will be replaced by an underscore!)
9595
: @return the results
9696
:)
97-
declare function mysql:execute(
97+
declare function mssql:execute(
9898
$connection-handle as xs:long,
9999
$statement-handle as xs:long,
100100
$parameters as element()?,

xar-assembly.xml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://expath.org/ns/pkg" name="${package-name}" abbrev="${package-abbrev}" version="${project.version}"
33
spec="1.0">
44
<title>${package-title}</title>
5-
<author id="my-organisation">My Organisation</author>
5+
<author id="my-organisation">eXist-db</author>
66
<website>${project.url}</website>
77
<license>GNU Lesser General Public License, version 2.1</license>
88
<copyright>true</copyright>
@@ -41,10 +41,10 @@
4141
<!-- include the XQuery Library modules written in XQuery from this project -->
4242
<xquerySets>
4343
<xquerySet>
44-
<namespace>https://exist-db.org/exist-db/ns/app/mysql</namespace>
44+
<namespace>https://exist-db.org/exist-db/ns/app/mssql</namespace>
4545
<directory>${basedir}/src/main/xquery</directory>
4646
<includes>
47-
<include>mysql-module.xqm</include>
47+
<include>mssql-module.xqm</include>
4848
</includes>
4949
<outputDirectory>content</outputDirectory>
5050
</xquerySet>
@@ -57,10 +57,9 @@
5757
<artifactId>${project.artifactId}</artifactId>
5858
<version>${project.version}</version>
5959
</dependencySet>
60-
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
6160
<dependencySet>
62-
<groupId>mysql</groupId>
63-
<artifactId>mysql-connector-java</artifactId>
61+
<groupId>com.microsoft.sqlserver</groupId>
62+
<artifactId>mssql-jdbc</artifactId>
6463
<version>${project.version}</version>
6564
</dependencySet>
6665
</dependencySets>

0 commit comments

Comments
 (0)