Tag: java

android application not connecting to mssql server 2008

this is my layout.xml <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:tools=”http://schemas.android.com/tools” android:layout_width=”match_parent” android:layout_height=”match_parent” android:orientation=”vertical” tools:context=”.MainActivity” > <TextView android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:id=”@+id/t1″ /> <TextView android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:id=”@+id/t2″ /> <TextView android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:id=”@+id/t3″ /> <TextView android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:id=”@+id/t4″ /> <TextView android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:id=”@+id/t5″ /> <Button android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:id=”@+id/btn2″ /> </LinearLayout> this is my activitymain.java package com.example.mssqlconnect; import android.os.Bundle; import java.sql.*; import net.sourceforge.jtds.jdbc.*; […]

JDBC SQLServerException: “This driver is not configured for integrated authentication.”

My standard disclaimer: I haven’t worked with Java in about 10 years, so it’s very probable I’m doing something elementary wrong here… I am writing a “server-side extension” for SmartFoxServer (SFS). In my login script, I need to make a connection to MS SQL Server, which I am attempting to do using JDBC. I have […]

SQL Server JBDC Driver comparison

Currently we use jtds for connecting to our SQL Server databases. I’ve always taken it for granted that we use it due to performance and reliability reasons, however, it’s usage pre-dates my employment. All of that being said, we are now playing with the idea of moving to SQL Server 2008, which jtds has limited […]

JDBC jar added to Classpath still receiving error

This question already has an answer here: ClassNotFoundException: com.microsoft.sqlserver.jdbc 3 answers

A cursor with the name … already exists – SQL Server 2008

I have a trigger that is used to perform some auditing tasks when changes are made to a table. Within this trigger there is a WHILE loop, and in the loop there is a cursor that is declared, used, closed and then deallocated before the next iteration of the loop. When I call a stored […]

Using a database API cursor with JDBC and SQLServer to select batch results

SOLVED (See answer below.) I did not understand my problem within the proper context. The real issue was that my query was returning multiple ResultSet objects, and I had never come across that before. I have posted code below that solves the problem. PROBLEM I have an SQL Server database table with many thousand rows. […]

Unable to execute stored Procedure using Java and JDBC on SQL server

I have been trying to execute a MS SQL Server stored procedure via JDBC today and have been unsuccessful thus far. The stored procedure has 1 input and 1 output parameter. With every combination I use when setting up the stored procedure call in code I get an error stating that the stored procedure couldn’t […]

How can I version control Stored Procedures while using flywaydb?

I currently have a Java web app which uses a Microsoft SQL Server back end. Database migrations are currently being done manually by sqlcmd which makes use of the :r command to reference script files of our stored procedures and views. This way each stored procedure has his own file “proc_someprocedure.sql” The migration is done […]

How do I use Java to read a .csv file and insert its data into SQL Server?

I am very new to Java. I have a task with two steps. I want to read all data from a .csv file. After reading that data I have to put it into a SQL Server database. I have done step one. I’m able to read the .csv file data, but I don’t know that […]

Passing a user-defined table type to a SQL Server stored procedure using JDBC

We’ve got this User-Defined-Table Type in MS SQL Server: CREATE TYPE [dbo].[INITVALS_MSG] AS TABLE( [SDate] [decimal](8, 0) NOT NULL, [EDate] [decimal](8, 0) NOT NULL, [PlantCode] [nvarchar](10) NOT NULL, [LoadType] [nchar](8) NOT NULL, [Asset] [bigint] NOT NULL ) and a Stored Procedure which takes that table as input: ALTER PROCEDURE [dbo].[RegisterInitAssets] @initmsg INITVALS_MSG ReadOnly AS BEGIN […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.