mssql-jdbc

Access token connection fails after some time with Login failed NT AUTHORITY\ANONYMOUS LOGON error

淺唱寂寞╮ 提交于 2020-01-06 07:54:04
问题 I have a Spring web application on an Azure App service that is connecting to an Azure SQL DB using the Microsoft JDBC driver authenticating using an access token. It initially works find but after some time I start to get SQLServerException: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON' I'm following the steps outlined in the MS docs. AuthenticationContext context = new AuthenticationContext(mySTSUrl, false, Executors.newFixedThreadPool(1)); ClientCredential cred = new

Same prepared statement, multiple databases, same schema

非 Y 不嫁゛ 提交于 2020-01-05 03:58:04
问题 I have multiple ms sql server databases x1, x2, x3, ... xn, effectively all the same schema type and one database y that is different and holds management data. I am using jdbc prepared statements and there are occasions when the same prepared statement needs to be executed on multiple x databases from one program at one occasion. If the prepared statement's SQL does not indicate a database: Is the prepared statement associated just with the server, and if executed is executed on a database

INSERT values in VARBINARY(MAX) column

我的梦境 提交于 2020-01-03 04:21:05
问题 I've table with VARBINARY(MAX) column and I'm tried for inserting value into that table.but I can't. QUERY is INSERT INTO [I_RACEDB].[dbo].[tce_lineno]([lineNo] ,[testCaseName] ,[project]) VALUES (<lineNo, varchar(250),> ,<testCaseName, varbinary(max),>,<project, varchar(100),>) INSERT INTO [I_RACEDB].[dbo].[tce_lineno] ([lineNo],[testCaseName],[project]) VALUES ('44','TestCase_TestCheck01_Mail_Validation','proj001') ERROR is: Implicit conversion from data type varchar to varbinary(max) is

Escape value in MSSQL Server with Java

末鹿安然 提交于 2019-12-25 06:36:34
问题 How can I escape a value for usage in a query to MSSQL Server? I know how it would be possible using JDBC but since I'm using SAP Business One DI API there is no way (I'm aware of) of using prepared statements. It would be sufficient to know how to escape string values while additionally knowing how to escape identifiers would be nice, too. Update : After reading New SQL Truncation Attacks And How To Avoid Them it seems sufficient to escape identifiers using [ (and doubling each occurrence of

Microsoft JDBC Driver is not working after upgrade from Java 1.7 to Java 1.8

谁说我不能喝 提交于 2019-12-25 00:35:29
问题 After upgrading from Java 1.7 to Java 1.8, I am getting the below error when having sqljdbc4.jar (version 4.0) in my build path. How can I resolve this problem? 回答1: In the details section of the download page for the driver, the Java compliance is listed: The Microsoft JDBC Driver 4.2 for SQL Server is JDBC 4.2 compliant and runs on the Java Development Kit (JDK) version 5.0, 6.0, 7.0, and 8.0 . The Microsoft JDBC Driver 4.1 for SQL Server is JDBC 4.0 compliant and runs on the Java

How to connect to remote MSSQL database using php 5.5.19

我是研究僧i 提交于 2019-12-24 13:50:31
问题 I have had a problem trying to establish a connection to a MSSQL database I created in Microsoft SQL Server Manager 2008 R2 using php 5.5.19 in XAMPP. In the php.ino configuration file under extensions, there is commented out a ';extension=php_mssql.dll'. I removed the comment and ran apache in the xampp control panel. Naturally an error occurred stating ''PHP Startup: Unable to load dynamic library '..\ext\php_mssql.dll cannot be found'. I looked in the ext directory and sure enough it wasn

How to convert MYSQL query into MSSQL query

不羁岁月 提交于 2019-12-24 02:46:06
问题 I've 700+ MySQL queries and now trying to create same set of queries in MSSQL. I want to generate MSSQL query with same MYSQL.Is any way to convert MYSQL query into MSSQL query. 回答1: From this article by Brian Swan, you can download the SQL Server Migration Assistant for MySQL tool and use it to convert a single MySQL query to a SQL Server query: Create a Project: All the information you need for downloading SSMA, creating a project and connecting to databases is in steps 1-6 of this blog

Migrating from jTDS JDBC driver to Microsoft JDBC

拈花ヽ惹草 提交于 2019-12-19 09:45:30
问题 Microsoft has recently released a new JDBC driver (version 6.0.7507.100) with some very interesting features. I am mostly interested in the TVP feature. This is why I would like to replace the current jTDS driver with the Microsoft driver. The problem arises when trying to log in to our production server. Lets say we use the domain user "mydomain\dbuser" to login to the sql server instance. This is the jtds jdbc url we have used so far: jdbc:jtds:sqlserver:/sqlServer:1433/myDb;domain=mydomain

“NoClassDefFoundError: javax/xml/bind/DatatypeConverter” with SQL Server JDBC

試著忘記壹切 提交于 2019-12-18 06:56:12
问题 I recently switched to intellij but I'm finding it hard to connect to my localDB. The same code worked on eclipse fine. Also I have already added the sqljdbc42.jar as a module dependency. package com.enter; import java.sql.*; public class SqlConnect { private String username, password, url; public Connection conn; public SqlConnect() { username = "user=admin;"; password = "password=admin"; url = "jdbc:sqlserver://Bossman-PC\\SQL2014TRAINING;databaseName=EnterDB;"; Connect(); } public

How do I resolve mssql resetting connections

匆匆过客 提交于 2019-12-11 20:46:16
问题 I keep getting this error randomly when I test an application with mssql and don't have an idea of what I can do to correct the issue. Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset ClientConnectionId:a2fb508d-0e8e-48b0-92ed-2d1f262b4db1 Error Code: 0 My setup consists of Eclipselink as the ORM sqljdbc v4.1 sql