mssql-jdbc

Can only connect to master database with JDBC Sql Server

故事扮演 提交于 2021-01-29 08:02:17
问题 I just successfully connected my android app with a database running on azure cloud services to run simple queries. The connection string provided by azure already specifies which database I want to connect to, but when it is trying to execute a select query in that database the table cannot be found because the query is being executed on Master database. jdbc:jtds:sqlserver://{servername}:1433;database=BDassistance;user={username};password={password};encrypt=true;trustServerCertificate=false

Spring batch: JdbcPagingItemReader doesn't obtain page 1 onwards

余生长醉 提交于 2020-12-15 00:30:46
问题 Here my reader: @Bean public ItemReader<Unitat> itemReader(PagingQueryProvider queryProvider) { return new JdbcPagingItemReaderBuilder<Unitat>() .name("creditReader") .dataSource(this.dataSource) .queryProvider(queryProvider) .rowMapper(this.unitatMapper) .pageSize(2) .build(); } @Bean public SqlPagingQueryProviderFactoryBean queryProvider() { SqlPagingQueryProviderFactoryBean provider = new SqlPagingQueryProviderFactoryBean(); provider.setDataSource(this.dataSource); provider.setSelectClause

Spring batch: JdbcPagingItemReader doesn't obtain page 1 onwards

余生长醉 提交于 2020-12-15 00:29:26
问题 Here my reader: @Bean public ItemReader<Unitat> itemReader(PagingQueryProvider queryProvider) { return new JdbcPagingItemReaderBuilder<Unitat>() .name("creditReader") .dataSource(this.dataSource) .queryProvider(queryProvider) .rowMapper(this.unitatMapper) .pageSize(2) .build(); } @Bean public SqlPagingQueryProviderFactoryBean queryProvider() { SqlPagingQueryProviderFactoryBean provider = new SqlPagingQueryProviderFactoryBean(); provider.setDataSource(this.dataSource); provider.setSelectClause

com.microsoft.sqlserver.jdbc.SQLServerException: MSI Token failure: Failed to acquire token from MSI Endpoint

我的梦境 提交于 2020-06-27 06:01:17
问题 I want to Access the Azure SQL Database using App service API(Java) with MSI (Managed Service Identity) authentication. I am trying to find out the how to connect Azure sql with MSI from Azure App service for Java. Here is the connection string I am using. jdbc:sqlserver://mysqldb.database.windows.net:1433;database=TestDB;Authentication=ActiveDirectoryMsi;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30; Here is the steps I used: Create

onprem machines to Azure Active Directory so we can access ActiveDirectoryMSI authentication as well as IMDS SERVER

元气小坏坏 提交于 2020-06-27 04:09:26
问题 We want to use AzureSqlServer with ActiveDirectoryMSI authentication as well as token-based authentication and We are able to execute successfully from VM created in Azure network and added as a member of the Azure AD group. For that, we have created Contained user by following the link https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/tutorial-windows-vm-access-sql And added the VM as part of AzureActiveDirectory by following this link com.microsoft

SQL Server: connect to database using NTLM authentication using Java 8

喜你入骨 提交于 2020-04-18 05:41:54
问题 I am trying to connect to SQL Server using my credentials. The data I am provided is to connect is the following: Server: Ccddb294\oss_prod Database: OSS_DW Code: public static void main(String arg[]) throws ClassNotFoundException, SQLException { Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); String dbURL = "jdbc:sqlserver://ccddb294.corp.corpcom.com:1433;databaseName=OSS_DW;integratedSecurity=true"; Connection conn = DriverManager.getConnection(dbURL,"corp\\e21290","Anjali

insert varbinary value from hex literal in Microsoft SQL Server

六眼飞鱼酱① 提交于 2020-02-24 12:23:05
问题 I have a SpringBoot app, where I use jdbcTemplate to insert a row to a mssql int numOfRowsAffected = remoteJdbcTemplate.update("insert into dbo.[ELCOR Resource Time Registr_] " + "( [Entry No_], [Record ID], [Posting Date], [Resource No_], [Job No_], [Work Type], [Quantity], [Unit of Measure], [Description], [Company Name], [Created Date-Time], [Status] ) " + " VALUES (?,CONVERT(varbinary,?),?,?,?,?,?,?,?,?,?,?);", ELCORResourceTimeRegistr.getEntryNo(), ELCORResourceTimeRegistr.getEntryNo()),

Manifest.MF issue with MSSQLSERVER 2008 and Groovy

拥有回忆 提交于 2020-01-22 02:11:14
问题 I have created a simple Groovy project in GGTS IDE that connects to Oracle and SQLServer. The Program runs fine within the IDE but when I run the program through the command line I seem to get some sort of enconding error in MANIFEST.MF?. See the stacktrace below: Command Line groovy -cp lib\ojdbc14_g.jar lib\sqljdbc4.jar src\Starter.groovy Result org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: C:\workspace-ggts-3.1.0.RELEASE\Test\lib\sqljdbc4.jar: 1:

TDSParser: Encountered unexpected unknown token (0xA3)

馋奶兔 提交于 2020-01-16 08:43:37
问题 When calling some specific stored procedures using mssql-jdbc , I get an jdbc internal error in Java: Jan 02, 2020 8:11:32 AM com.microsoft.sqlserver.jdbc.TDSParser throwUnexpectedTokenException SCHWERWIEGEND: ConnectionID:5 ClientConnectionId: 30dcbc6e-ec5c-45ba-8801-1ecc549a0cd4: getNextResult: Encountered unexpected unknown token (0xA3) Jan 02, 2020 8:11:32 AM com.microsoft.sqlserver.jdbc.TDSReader throwInvalidTDSToken SCHWERWIEGEND: ConnectionID:5 ClientConnectionId: 30dcbc6e-ec5c-45ba

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

早过忘川 提交于 2020-01-06 07:55:10
问题 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