jtds

Cannot access SQL Server database using jtds

南笙酒味 提交于 2019-12-25 09:45:23
问题 I am trying to access a SQL Server database using Java and jtds. This is my (very) simple code: String url = "jdbc:jtds:sqlserver://dev.company.com:1433/master;domain=COMP;USENTLMV2=true;SSL=request"; String driver = "net.sourceforge.jtds.jdbc.Driver"; String userName = "COMP\\username"; String password = "s3cr3t"; Connection conn = null; try { Class.forName(driver); conn = DriverManager.getConnection(url, userName, password); } catch (Exception e) { e.printStackTrace(); } finally { conn

JTDS Android connect to SQL Server - Error Connection null

回眸只為那壹抹淺笑 提交于 2019-12-23 21:03:14
问题 hi im trying to connect to my MS SQL Server 2008 R2 from my Android application this is the code: try { Log.i("Login", "Establishing Connection..."); // SET CONNECTIONSTRING Class.forName("net.sourceforge.jtds.jdbc.Driver").newInstance(); Log.i("JDBC","found"); Connection DbConn = DriverManager.getConnection("jdbc:jtds:sqlserver://MYPC/" + DB + ";instance=SQLEXPRESS;user=" + USERNAME + ";password=" + PASSWORD); Log.i("Login","Connected"); Statement stmt = DbConn.createStatement(); ResultSet

How to connect Android application to SQL Server through jbdc?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 05:27:59
问题 I have tried to connect my Android app to SQL Server using jtds but it gives a login error. I have use jtds1.2.7-jar in my libs folder My code is: public class MainAct extends Activity{ EditText e; Button bt; ListView lv; Connection connect; SimpleAdapter sm; public void declere(){ e=(EditText)findViewById(R.id.et1); bt=(Button)findViewById(R.id.bt1); lv=(ListView)findViewById(R.id.list); } public void initilize(){ declere(); e.setText("SELECT TOP 10 * FROM FORM1"); connect=CONN("sa","cbo

Using jTDS to connect to SQL Server 2012 availability group listener

对着背影说爱祢 提交于 2019-12-23 03:35:12
问题 I am working on a legacy project that uses jTDS to connect to SQL server. The client wants us to support SQL Server 2012 AlwaysOn. one key requirement is the ability of our application to automatically reconnect to secondary server in event of failover. unfortunately, jTDS 3.0 does not support AlwaysOn. I have 2 options use MS JDBC (http://www.microsoft.com/en-us/download/confirmation.aspx?id=11774) Write a wrapper that returns the connection string after checking the status of the active

Android studio can't connect to database in Azure sql server

孤街浪徒 提交于 2019-12-22 17:09:05
问题 I am using android studio to develop an application and using Azure Sql Server to host my database. The problem is I was able to connect to my database on SQL server but it has an error of Object not found in my database. I found out that it might be connecting to my master database instead of the database I want it to connect to. Is there any solution to solve the problem? package com.example.lenovo.testing1; import android.annotation.SuppressLint; import android.os.StrictMode; import

Android studio can't connect to database in Azure sql server

北战南征 提交于 2019-12-22 17:08:15
问题 I am using android studio to develop an application and using Azure Sql Server to host my database. The problem is I was able to connect to my database on SQL server but it has an error of Object not found in my database. I found out that it might be connecting to my master database instead of the database I want it to connect to. Is there any solution to solve the problem? package com.example.lenovo.testing1; import android.annotation.SuppressLint; import android.os.StrictMode; import

JTDS and JBOSS JDBC Connection Pool Problem, any solution? Maybe a custom ValidConnectionChecker?

无人久伴 提交于 2019-12-21 02:37:19
问题 I'm facing a weird production problem. Environment is the following: JBOSS 4.0.2 SQL Server 2005 Driver JTDS 1.2.5 From time to time the following szenario occurs. A SQL command fails to Excute with java.sql.SQLException: I/O Error: Read timed out (I can live with that, if it just happens twice a day or so) But from that moment on the connection seems to be wasted without the pool recognizing it, as I continously receive java.sql.SQLException: Invalid state, the Connection object is closed.

Stored Proc slower from application than Management Studio

末鹿安然 提交于 2019-12-20 06:38:48
问题 We have a stored proc which runs pathetically when called from application (Spring - DBCP - jtds) infact timesout after 10 minutes, but runs in 30 seconds when executed from SQL Server Managament Stuido. Can someone provide leads into this issue? 回答1: This normally indicates a parameter sniffing issue. See Slow in the Application, Fast in SSMS? Understanding Performance Mysteries for details. 来源: https://stackoverflow.com/questions/7504273/stored-proc-slower-from-application-than-management

jTDS incorrectly reports data type info in result set metadata (for DATE columns, reports NVARCHAR)

橙三吉。 提交于 2019-12-20 03:48:09
问题 Currently, the jTDS JDBC driver (1.2.5) against Microsoft SQL Server 2008 appears to incorrectly report the data type for DATE columns as NVARCHAR. It probably behaves the same for both earlier versions of jTDS and SQL Server (2005, 2000) Are there any workarounds for this that don't require switching to a different driver (for example Microsoft's own driver) or patching the jTDS driver? Also I would like to avoid having to perform queries against the data dictionary (INFORMATION_SCHEMA

JDBC - JTDS bug ? For columns of type date and time(x)

孤者浪人 提交于 2019-12-20 03:00:37
问题 When I'm trying to get column type from ResultSetMetaData with method getColumnTypeName for types date and time(x) , I'm getting nvarchar . For other types seems it works fine. Is this a bug? With ResultSet getString("TYPE_NAME") it seems ok. I'm running on MSSQL2008 @a_horse_with_no_name ResultSetMetaData I'm getting when executing query. In that case I haven't any tables. Here is the code snippet if (resultType == ResultMappingType.QUERY){ // For Query Statement statement = con