sqlexception

Getting TDS driver - java.lang.NullPointerException. this exception is not consistent

核能气质少年 提交于 2020-01-03 06:46:14
问题 I am getting exception when a method is called from 3 or 4 threads. This method get a DataBase connection inside method and populate some values from DB and then connection (connection, resultset and prepareStatement) getting closed properly inside method only. Still getting exception. Thread_1 - abc() method called. connection opened and closed inside method. Thread_2 - abc() method called. connection opened and closed inside method. Thread_3 - abc() method called. connection opened and

java.sql.SQLException: ORA-00904

戏子无情 提交于 2019-12-31 04:30:10
问题 I am getting this below exception- java.sql.SQLException: ORA-00904: : invalid identifier ORA-06512: at line 1 Below is the query that I am trying to execute- public static final String DATABASE_TABLE = "LnPData"; public static final String CREATE_SQL = "DECLARE " + "t_count INTEGER; " + "v_sql VARCHAR2(1000) := 'create table " +DATABASE_TABLE + "(" + "(ID number(10,0), " + "CGUID VARCHAR(255), " + "PGUID VARCHAR(255), " + "SGUID VARCHAR(255), " + "USERID VARCHAR(255), " + "ULOC VARCHAR(255),

RAISERROR―How to distinguish with SqlException?

馋奶兔 提交于 2019-12-30 02:20:10
问题 I have some 3-4 stored procedures ― which I can modify if needed ― that use RAISERROR to inform my application of some fatal errors on the database side. Some of these stored procedures are executed from the C# side with ExecuteNonQuery , while other are executed with ExecuteReader . At the moment, I am wrapping these command in a try { ... } catch (SqlException ThisSqlException) { ... } block, but the problem is that this exception will be thrown in at least two scenarios I must deal with

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

你离开我真会死。 提交于 2019-12-29 09:14:36
问题 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 oracle.jdbc.OracleDriver; public class Main { public static void main(String[] args) { System.out.println("Hello World !!!"); String partitaIVA = args[0]; String nomePDF = args[1]; Connection conn = null; Statement stmt = null; try { Class.forName (

SqlException: System.Data.SqlClient.SqlException (0x80131904)

被刻印的时光 ゝ 提交于 2019-12-29 09:06:44
问题 I wrote a code in C#, which works great at my computer, with Windows 7 (MS SQL Server 2008) but not at the other with Windows Vista (MS SQL Server 2005). I can not change system on the second computer ;) I'm using Visual Studio 2010. So this is the part of code, from my class "obSQL": private SqlConnection connection; public obSQL(string user, string pass, string instance, string dbdir) //sql server authentication { connection = new SqlConnection(); connection.ConnectionString = "user id=" +

INFORMIX error on running a Java program [closed]

允我心安 提交于 2019-12-25 18:17:13
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I have been trying to connect to an Informix database using a small program written in Java. The program is working nicely on one of the Informix test servers but on running in one of the production system it gives us the following exception: java.sql.SQLException: INFORMIXSERVER does not match either

How to know which entity caused SQL Exception

坚强是说给别人听的谎言 提交于 2019-12-25 09:42:19
问题 I'm using hibernate with spring to create a restful service app. I want to return an error message when an operation fails. For example while creating an account if a duplicate primary key is detected, I want to set the message that the username is not available. try { Account account = accountDao.createAccount(accName, emailAdd); result.accountId = account.getIdAccount(); } catch (DataAccessException e) { result.errorMessage = "something like this account name is already taken"; <*****

Underlying Provider Failed on Open

萝らか妹 提交于 2019-12-25 08:21:22
问题 I have a Test that i am running from NUnit but it keeps failing [Test] public void CheckTeamsExist() { UsersContext context = new UsersContext(); var count = context.Events.Count(); Assert.AreSame(true, count > 10); } The exact error message i am getting is QUBBasketballMVC.Tests.Controllers.TeamContextTest.CheckTeamsExist: System.Data.EntityException : The underlying provider failed on Open. ----> System.Data.SqlClient.SqlException : An attempt to attach an auto-named database for file C:

Web service with database : SqlException

北慕城南 提交于 2019-12-25 05:07:29
问题 I wrote a web service which works with SQL Server'08 Database When I try to invoke a web method, I get this: System.Data.SqlClient.SqlException: Login failed for user 'IIS APPPOOL\ASP.NET v4.0'. at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet

How to use Try Catch to display Login failure for (App.Config) connection string

可紊 提交于 2019-12-25 03:34:53
问题 My coding is simplified by using a single line of code to connect to MS-SQL 2008 R2 Databases. However I wish to have a msgbox displayed on login/password failure. Here's the coding. My.Settings.Item("CustomerConnectionString") = "Data Source=.\SQLEXPRESS; Initial Catalog=customer; uid = temp ; pwd = temp" << catch error required >> Thanks. 回答1: First assign the value to app.config connection string: My.Settings.Item("CustomerConnectionString") = "Data Source=FAROOK-PC\SQLEXPRESS;Initial