sqlexception

How to catch SqlException caused by deadlock?

From a .NET 3.5 / C# app, I would like to catch SqlException but only if it is caused by deadlocks on a SQL Server 2008 instance. Typical error message is Transaction (Process ID 58) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. Yet, it does not seem to be a do...

How to catch properly an SqlException: A transport-level error has occurred ...

I am getting an SqlException in the logs of .NET 3.5 app, I am looking for the corresponding number (value of the property SqlException.Number). System.Data.SqlClient.SqlException: A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The specified network name is no longer av...

java.sql.SQLException: [NCR][Teradata JDBC Driver]: addBatch not supported

Hi, i am getting this(java.sql.SQLException: [NCR][Teradata JDBC Driver]: addBatch not supported) error while trying to execute a query in my application. i am using addBatch with preparedstatement for constructing the statement and using executeBatch for executing the query. Cant we use addBatch with preparedStatement for Teradata DB...

DB2 SQL Exception while executing query

in DB2 while executing a query i got SqlException: DB2 SQL Error: SQLCODE=-668, SQLSTATE=57016 does someone knows what this code means? ...

Is it possible anyhow to raise system exception on catching exception manually?

I am writing a stored procedure where i m using try catch block. Now i have a unique column in a table. When i try to insert duplicate value it throws exception with exception no 2627. I want this to be done like this if (exists(select * from tblABC where col1='value')=true) raiseError(2627)--raise system error that would have thrown...

how to store "2010-03-26 10:13:04 Etc/GMT" mysql?

Hi All, I would like to store "2010-03-26 10:13:04 Etc/GMT" value in column of type datetime. when i try to insert it i got exception SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '10:13:04 Etc/GMT', at line 1 how to insert data tim...

Are there SqlExceptions which throw but commit their data anyway?

I've recently encountered the error: System.Data.SqlClient.SqlException: The transaction log for database 'mydatabase' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases on one of my windows services. It's supposed to retry after catching an Sql Exception, wha...

Exception while calling stored procedure :Bigger type length than Maximum

HI I am getting this exception when I am calling any stored procedure from my J2EE app. Exception while calling stored procedure :Bigger type length than Maximum I am having Oracle 9.1.0.7, JDK1.4 and using ojdbc14.jar running on Weblogic 8.1 Please advise what could be the root cause ? Below is the manifest of my ojdbc14.jar ...

VB.NET SqlException Was Unhandled

I am trying some SQL code but I get an error when I try this code. Main.database.ExecuteCommand("UPDATE Contacts SET first_name='" + c.first_name + _ "', middle='" + c.middle + _ "', last_name='" + c.last_name + _ "', age='" + c.age + _ ...

architecture mismatch between the Driver and Application?

I am using JDBC to connect to my microsoft access database. I get the following exception when I try to connect to the database: java.sql.SQLException: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application I am using 64bit windows7, and I am using eclipse which is al...

Is there a 64bit driver for Microsoft Access?

java.sql.SQLException: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application I get the following error when I try to connect to my Microsoft Access database from an eclipse project using jdbc. I am using 64bit windows and microsoft office 2007. any help on this matt...

Obtain the Query/CommandText that caused a SQLException

Hello stackers, I've got a logger that records exception information for our in house applications. When we log SQL exceptions it'd be super useful if we could see the actual query that caused the exception. Is there a way we can achieve this? ...

SqlConnection error Named Pipes Provider

A little background: I have a Windows .NET application that is in use by approximately 40 field employees across North America. This program allows the users to enter data while in the field (away form internet access) and then synchronizes to our Sql Server 2005 database at night. A couple days ago, two of my users reported getting t...

VB.NET - SqlException: Could not locate entry in sysdatabases for database...

Hello, I want to backup my database using Linq to SQL: Dim sql As String = "BACKUP DATABASE SeaCowDatabase TO DISK = _ '" + sfd.FileName + "'" db.ExecuteCommand(sql) But instead, I get this error: System.Data.SqlClient.SqlException (0x80131904): Could not locate entry in sysdatabases for database 'SeaCowDatabase'. No entry fo...

SqlException timeout causing TransactionInDoubtException

A TransactionInDoubtException is being thrown, the cause is a SQLException due to a SQL Timeout. But I don't understand the connection. Any tips on how to make the create a SQLException for a timeout appreciated too. How can a SQLException cause a TransactionInDoubtException? Is it because the TransactionManager has DB stuff to close b...

What is the difference between SqlException and SqlExecutionException?

What is the difference between SqlException and SqlExecutionException? I understand that SqlException is an exception (or warning) thrown by SqlServer itself. But in what cases the SqlExecutionException is thrown? Why it is defined under System.Web.Management namespace? ...

Query returns "No data found" JSP/Oracle

I've been looking this over for a while now and can't seem to pinpoint the problem. Does anything stand out that would cause a java.sql.SQLException: No data found ResultSet rs = null; rs = s.executeQuery("SELECT * FROM customer"); out.println("<tr><th>Customer ID</th><th>First Name</th>&nbsp;</th></tr>"); while(rs.next()) { ou...

sqlexception message display causes error on page

...

java.sql.SQLException: Cannot add or update a child row: a foreign key constraint fails

Hi Could someone help me understand that why am I getting the following error when I am trying to persist ServiceProvider entity? java.sql.SQLException: Cannot add or update a child row: a foreign key constraint fails (`springmvc/businesslocation`, CONSTRAINT `FK5CB747B5A26ED80E` FOREIGN KEY (`state_id`) REFERENCES `state` (`id`)) at ...

SqlException timeout on GetConnection, but only from one node in a cluster

We have two nodes in a cluster. Both run an ASP.NET web application that connects to a database on another server. Node1 has no problems, but Node2 throws SqlExceptions, stating there's a timeout. The stacktrace shows me it's on DbConnectionPool.GetConnection. I checked the versions of our DLLs, the web.config files, the connection stri...