26
votes
5answers
57k views

Can I connect to SQL Server using Windows Authentication from Java EE webapp?

I am currently investigating how to make a connection to a SQL Server database from my Java EE web application using Windows Authentication instead of SQL Server authentication. I am running this app ...
22
votes
9answers
8k views

Driver.getConnection hangs using SQLServer driver and Java 1.6.0_29

I didn't know where to write something about this and decided to do it here. After loooong time debugging my program I could find out that calling Driver.getConnection(string, string, string) hangs ...
16
votes
9answers
43k views

How to make Java work with SQL Server?

I know this is a basic question, but I can't seem to find an answer and I apologize, if this question is way too stupid, but here we go: I am supposed to work with SQL Server (no problem so far) and ...
14
votes
3answers
8k views

identity from sql insert via jdbctemplate

Is it possible to get the @@identity from the SQL insert on a Spring jdbc template call? If so, how?
14
votes
4answers
17k views

Run sqlcmd without having SQL Server installed

I'm working on a Java program that is calling sqlcmd. It works perfectly on a computer with SQL server installed, but not at all on a computer that doesn't. I want to include the necessary exe and ...
12
votes
6answers
28k views

Get row count of a resultset in Java

I'm trying to create a simple method that receives a ResultSet as a parameter and returns an int that contains the row count of the ResultSet. Is this a valid way of doing this or not so much? int ...
10
votes
2answers
51k views

java.sql.SQLException: No suitable driver found for jdbc:microsoft:sqlserver

I'm getting this exception when I try to run this program. It's one of the Microsoft examples. I've added the sqljdbc4.jar to the classpath in netbeans for both compile and Run, via the project ...
10
votes
4answers
2k views

Date columns in SQL-Server (MSSQL-JDBC 3.0) running under Java 1.7.0 retrieved as 2 days in the past

I have strange effects when retrieving columns of type DATE from SQLServer2008 using the Microsoft JDBC-Driver version 3.0 when running under the official Oracle JDK 1.7.0. Host OS is Windows Server ...
9
votes
3answers
20k views

What is the jTDS JDBC Connect URL to MS SQL Server 2005 Express

I'm trying to connect to a MS SQL Server 2005 Express database that is running on the local host from a java program. I have tried the same connect URL (below) that I used on another system (same ...
9
votes
2answers
226 views

How do I retrieve the last inserted value in my database?

Can anybody tell me the query for last inserted value in the column of the database. The problem is that inserted value can be placed in inner rows of the database after using ASC or DESC so I cant ...
8
votes
9answers
28k views

How can I make MS SQL Server available for connections?

I'm trying to connect to MS SQL Server (running on my machine) from a Java program. I'm getting the following long winded exception: Exception in thread "main" ...
8
votes
1answer
5k views

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 ...
7
votes
2answers
37k views

how to configure hibernate config file for sql server

here is the config file for mysql <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">org.gjt.mm.mysql.Driver</property> ...
7
votes
2answers
2k views

What are the difference between: sequence id using JPA @TableGenerator, @GeneratedValue vs database Auto_Increment

Q1.: What is the difference between applying sequence Id in a database using A. CREATE TABLE Person ( id long NOT NULL AUTO_INCREMENT ... PRIMARY KEY (id) ) versus B. @Entity public ...
7
votes
7answers
62k views

How do I connect to a SQL Server 2008 database in Java with JDBC?

I have MSSQL 2008 installed on my local PC, and my Java application needs to connect to a MSSQL database. I am a new to MSSQL and I would like get some help on creating user login for my Java ...

1 2 3 4 5 50
15 30 50 per page