jtds

Java Hibernate with SQL Server 2012 not working?

本小妞迷上赌 提交于 2019-11-26 23:22:55
问题 I have a Java Hibernate project configuration which worked with SQL Server 2008 R2, now with a new OS 8.1 (from 7) and SQL Server 2012 (express), I'm unable to connect to SQL server. Relevant configuration which is/should be syntactically correct since it worked with 2008 R2: datasource.properties jdbc.driverClassName=net.sourceforge.jtds.jdbc.Driver jdbc.url=jdbc:jtds:sqlserver://localhost:1433/dbname;instance=SQLEXPRESS jdbc.username=auser jdbc.password=xyz I've tried two dialects org

Is it possible to run multiple DDL statements inside a transaction (within SQL Server)?

空扰寡人 提交于 2019-11-26 23:03:01
I'm wondering if it is possible to run multiple DDL statements inside a transaction. I'm specially interested on SQL Server, even though answers with other databases (Oracle, PostgreSQL at least) could also be interesting. I've been doing some "CREATE TABLE" and "CREATE VIEW" for the created table inside a transaction and there seems to be some inconsistencies and I'm wondering if the DDLs shouldn't be done inside the transaction... I could probably move the DDL outside the transaction but I'd like to get some reference for this. What I have found this far: MSDN page Isolation Levels in the

Authenticating to a SQL Server instance as a Windows User via JDBC

放肆的年华 提交于 2019-11-26 21:19:21
问题 I'm having to support multiple database types for my tenant-enabled web application. Among others, I have successfully supported Microsoft's SQL Server, by using the net.sourceforge.jtds.jdbc.Driver class with a connection String like "jdbc:jtds:sqlserver://192.168.1.189:1433/ApplicationName". This works, but it requires that the user explicitly defines a user in the SQL Server instance and enables SQL Server authentication. Now, inevitably, requirements changed, and we're supposed to support

Create a jTDS connection string

时光总嘲笑我的痴心妄想 提交于 2019-11-26 15:52:17
my sql server instance name is MYPC\SQLEXPRESS and I'm trying to create a jTDS connection string to connect to the database 'Blog'. Can anyone please help me accomplish that? I'm trying to do like this: DriverManager.getConnection("jdbc:jtds:sqlserver://127.0.0.1:1433/Blog", "user", "password"); and I get this: java.sql.SQLException: Network error IOException: Connection refused: connect at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:395) at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50) at net.sourceforge.jtds.jdbc.Driver.connect(Driver

java : non-static variable cannot be referenced from a static context Error

那年仲夏 提交于 2019-11-26 11:56:30
The following code is generating an error on the variable con2 saying "non-static variable con2 cannot be referenced from a static context Error." I Googled for a resolution and they are suggesting the variable isn't initalized yet to make the methods available. Am I initializing this incorrectly? I also tried changing things to public but that didn't help either. import java.io.*; import java.net.*; import java.sql.*; import java.sql.CallableStatement; import java.sql.ResultSet; import java.sql.PreparedStatement; import net.sourceforge.jtds.jdbcx.JtdsDataSource; import net.sourceforge.jtds

Is it possible to run multiple DDL statements inside a transaction (within SQL Server)?

半城伤御伤魂 提交于 2019-11-26 08:34:56
问题 I\'m wondering if it is possible to run multiple DDL statements inside a transaction. I\'m specially interested on SQL Server, even though answers with other databases (Oracle, PostgreSQL at least) could also be interesting. I\'ve been doing some \"CREATE TABLE\" and \"CREATE VIEW\" for the created table inside a transaction and there seems to be some inconsistencies and I\'m wondering if the DDLs shouldn\'t be done inside the transaction... I could probably move the DDL outside the

java : non-static variable cannot be referenced from a static context Error

你离开我真会死。 提交于 2019-11-26 03:34:46
问题 The following code is generating an error on the variable con2 saying \"non-static variable con2 cannot be referenced from a static context Error.\" I Googled for a resolution and they are suggesting the variable isn\'t initalized yet to make the methods available. Am I initializing this incorrectly? I also tried changing things to public but that didn\'t help either. import java.io.*; import java.net.*; import java.sql.*; import java.sql.CallableStatement; import java.sql.ResultSet; import