mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-04 12:17:41 +08:00
PL-8826 Use native Microsoft SQL Server JDBC driver
This commit is contained in:
parent
fb61c28000
commit
6cca4464ed
@ -168,7 +168,7 @@ public class DbUpdaterUtil extends DbUpdaterEngine {
|
||||
dbDriver = "org.postgresql.Driver";
|
||||
break;
|
||||
case "mssql":
|
||||
dbDriver = "net.sourceforge.jtds.jdbc.Driver";
|
||||
dbDriver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
|
||||
break;
|
||||
case "oracle":
|
||||
dbDriver = "oracle.jdbc.OracleDriver";
|
||||
|
@ -31,16 +31,16 @@ public class DbPropertiesTest {
|
||||
DbProperties dbProperties = new DbProperties(null);
|
||||
Assert.assertNull(dbProperties.getProperties());
|
||||
|
||||
dbProperties = new DbProperties("jdbc:jtds:sqlserver://localhost/refapp_6");
|
||||
dbProperties = new DbProperties("jdbc:sqlserver://localhost");
|
||||
Assert.assertNull(dbProperties.getProperties());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWithParamsPostgres() {
|
||||
DbProperties dbProperties = new DbProperties("jdbc:jtds:sqlserver://localhost/refapp_6;currentSchema=Person");
|
||||
DbProperties dbProperties = new DbProperties("jdbc:sqlserver://localhost;databaseName=refapp_6;currentSchema=Person");
|
||||
Map<String, String> properties = dbProperties.getProperties();
|
||||
Assert.assertNotNull(properties);
|
||||
Assert.assertTrue(properties.size() == 1);
|
||||
Assert.assertTrue(properties.size() == 2);
|
||||
Assert.assertTrue("Person".equals(properties.get("currentSchema")));
|
||||
|
||||
dbProperties = new DbProperties("jdbc:postgresql://localhost/refapp_6?currentSchema=Person");
|
||||
@ -60,10 +60,10 @@ public class DbPropertiesTest {
|
||||
|
||||
@Test
|
||||
public void testWithParamsMssql() {
|
||||
DbProperties dbProperties = new DbProperties("jdbc:jtds:sqlserver://localhost/refapp_6;currentSchema=Person");
|
||||
DbProperties dbProperties = new DbProperties("jdbc:sqlserver://localhost;databaseName=refapp_6;currentSchema=Person");
|
||||
Map<String, String> properties = dbProperties.getProperties();
|
||||
Assert.assertNotNull(properties);
|
||||
Assert.assertTrue(properties.size() == 1);
|
||||
Assert.assertTrue(properties.size() == 2);
|
||||
Assert.assertTrue("Person".equals(properties.get("currentSchema")));
|
||||
Assert.assertTrue("Person".equals(dbProperties.getCurrentSchemaProperty()));
|
||||
|
||||
|
@ -2,7 +2,7 @@ org.apache.tomcat/tomcat-servlet-api = 8.0.26
|
||||
|
||||
org.postgresql/postgresql = 9.4-1201-jdbc41
|
||||
org.hsqldb/hsqldb = 2.3.3
|
||||
net.sourceforge.jtds/jtds = 1.3.1
|
||||
com.microsoft.sqlserver/mssql-jdbc = 6.1.0.jre8
|
||||
mysql/mysql-connector-java = 5.1.38
|
||||
|
||||
commons-logging/commons-logging = 1.2
|
||||
|
@ -188,7 +188,24 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
]]></license>
|
||||
</item>
|
||||
|
||||
<item name="jTDS" web="http://jtds.sourceforge.net/" license="lgpl-3"/>
|
||||
<item name="Microsoft JDBC Driver for SQL Server" web="https://github.com/Microsoft/mssql-jdbc">
|
||||
<license><![CDATA[
|
||||
Copyright(c) 2017 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.
|
||||
]]></license>
|
||||
</item>
|
||||
|
||||
<item name="JUnit" web="http://www.junit.org/" license="cpl-1.0"/>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user