Questions tagged [sqlexception]

An exception that is thrown when the database driver encounters an error. This tag could be used for both C# `SqlExpection` and Java `SQLException`.

C#

SqlException is thrown when encounters a SQL Server related error.

SqlException is the class used by System.Data.SqlClient library to represent an error either communicating with, or generated by, SQL Server.

For errors that are generated by the SQL Server, the Number property will contain SQL Server's error number and Class contains the severity. If there was more than one error or warning returned by the server, then the details of the exception will be populated by the first error\warning and any other errors and warnings can be viewed in the Errors property.

For communication errors, the Message will contain the error details from the network provider and, with .Net 4.5 and above, the InnerException will contain the relevant Win32Exception.

For more information onSqlException, see its MSDN page

Java

An exception that provides information on a database access error or other errors, could be thrown by driver. See official javadoc for more details.

875 questions
6
votes
1 answer

Android - Oracle 12c Database Connection Issue : java.sql.SQLException: ORA-28040: No matching authentication protocol

Since last 3 days I am getting problem with just simple connection of Android - Oracle 12c Database. Recently I have uploaded Android-Oracle-Connection but its for 11g version. I have used ojdbc14.jar I have used following lines of code in that…
Pratik Butani
  • 60,504
  • 58
  • 273
  • 437
6
votes
3 answers

What does this BatchUpdateException mean?

I'm getting this BatchUpdateException from a stmt.executeBatch() statement: BatchUpdateException: A resultset was created for update The internet does not have any information on this exception message. What does it mean? The traceback doesn't…
Björn Lindqvist
  • 19,221
  • 20
  • 87
  • 122
6
votes
5 answers

SQLException - Transaction BEGIN / COMMIT mismatch

Have you encountered this exception for a stored procedure which does indeed have a balanced transaction block? I double-checked the stored procedure and it has exactly one TRANSACTION BEGIN and cooresponding TRANSACTION END Error…
Chris Ballance
  • 33,810
  • 26
  • 104
  • 151
6
votes
2 answers

MySQL rollback in handler

I have a stored procedure where I'd like to rollback in case anything goes wrong. In order to do that I'm using a EXIT HANDLER like this: DECLARE EXIT HANDLER FOR sqlexception begin ROLLBACK; end; But in this way, when I call this…
Stefano Giacone
  • 2,016
  • 3
  • 27
  • 50
6
votes
1 answer

How to set the timezone region for JDBC Connection and avoid the SqlException timezone region not found?

I have the following problem trying to create a Connection object to handle the connection from a command line Java application and an Oracle database. So I have a Main class that contains the main() method, this one: import java.sql.*; import…
AndreaNobili
  • 40,955
  • 107
  • 324
  • 596
6
votes
10 answers

Difference between Exception and SQLException

Can someone explain the difference between catching an Exception and catching an SQLException? I know that SQLException will print out more information if you choose to print out the exception errors, but is there anything else? try { //code }…
javaGeek
  • 304
  • 1
  • 4
  • 11
6
votes
3 answers

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…
Joannes Vermorel
  • 8,976
  • 12
  • 64
  • 104
6
votes
2 answers

java.sql.SQLException: No suitable driver found

I am trying to execute simple query using below DbQuery.java class which uses DbConnector to get a Connection from DriverManager. note: I have already included "mysql-connector-java-5.1.25-bin.jar" on my classpath via:…
rohtakdev
  • 956
  • 1
  • 13
  • 16
6
votes
2 answers

Java SQL Exception Invalid Cursor State - no current row

I've been having a hard time trying to figure this out. First I have an insertProduct(Product p) method that is supposed to check if a product with the specified code exists in the database. If so, this method will display an error message.…
oxxi
  • 452
  • 3
  • 11
  • 28
6
votes
1 answer

Changing my query and causing SQL exception

I'm lovin MiniProfiler for our .NET project. However, I'm running into an issue. The profiler is actually causing queries to be slightly different which is causing errors. For example, when the profiler is not initialized, a SQL query is generated…
Cameron Askew
  • 1,403
  • 1
  • 12
  • 20
6
votes
3 answers

Java: Missing Database error

I am getting the following error: java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (no such table: apartments) In reality, the table does exist. The following is my code: try { // load the sqlite-JDBC driver using the current…
Volatil3
  • 14,253
  • 38
  • 134
  • 263
6
votes
4 answers

Receiving SQLException "Login failed for user" connecting to SQL Server 2008

I am trying to connect to SQL Server 2008 via Java. I've added sqljdbc4.jar to my project's library. No username and password is set for database accessing the database (Windows Authentication). The 1433 port is Listening, but I still receive this…
Sal-laS
  • 11,016
  • 25
  • 99
  • 169
6
votes
9 answers

Recommended approach on handling SqlExceptions in db applications

I work on a database application written in C# with sql server as backend. And for data integrity, I try to enforce as much as possible on database level - relations, check constraints, triggers. Due to them, if data is not consistent, the save /…
bzamfir
  • 4,698
  • 10
  • 54
  • 89
6
votes
1 answer

Entity Framework Migrations: Timeout SqlException during migrating

Sql Server is accessible. I want to migrate database using Entity Framework migrations. There i have "Images" table with 130k records having images. In migration there "INDEX" added to these table using "CREATE INDEX". I get SqlException that…
5
votes
1 answer

Why Is SqlException Getting Reused On Connection Failure

In the following code the connection string password is intentionally incorrect to cause a SqlException on opening the connection. while (true) { try { SqlConnection conn = new…
Joshua Marble
  • 540
  • 3
  • 9