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`.
835
questions
-1
votes
3answers
33 views
How to fix: “Parameter index out of range (1 > number of parameters, which is 0)” error in java?
I'm trying to learn JDBC Transactions I wrote some basic code to test it. However, while I'm running the code there are shown some errors in the output. Anyone could help me why is this happening and ...
0
votes
0answers
34 views
PostgreSQL, Java : How to print jast the RAISE EXCEPTION message without info about the place in the code?
This is my java method:
public static boolean addEmployee(Employee employee) {
String sql = "SELECT addemployee(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);";
try (Connection ...
0
votes
1answer
41 views
SQLException : Access denied for user 'utilisateur1'@'localhost' (using password: YES) [duplicate]
package com.exmaven2;
import java.sql.*;
public class MainApp
{
public static void main(String[] args)
{
String url = "jdbc:mysql://localhost:3306/baseune";
String ...
0
votes
0answers
18 views
Receiving SQL exception error while trying to connect with MySQL database through code. ( java.lang.ClassCastException: java.math.BigInteger) [duplicate]
Please find below the connection manager class which is I am using to create a connection.
public class DatabaseConnectionManager {
private final String url;
private final Properties properties;
...
0
votes
0answers
14 views
SqlDataAdapter.Fill method is throws SqlException when the BUILTIN/Administrators language is British English
our c# application uses SqlDataAdapter to fetch data from the DB to present in a report. For some reason the SqlDataAdapter.Fill method is throwing below SqlException when the BUILTIN/Administrators ...
0
votes
0answers
19 views
I am having Sqoop import error Error: java.io.IOException: SQLException in nextKeyValue
sqoop import --connect $jdbcurl --username $dbUserName --password-file $passwordLocal \
--query "select row_wid, serial_num from table1 where \$CONDITIONS" --target-dir $outputDir --...
-1
votes
2answers
29 views
Is there a way to handle SQLExceptions that are generated by SqlDataSource
I have been experiencing a problem with one of my vb applications where it is crashing at a certain time of day. In my code, there are only 4 places where that could be the cause of the crash. Three ...
0
votes
1answer
38 views
Conversion failed when converting the nvarchar value 'abc' to data type int in nopcommerce 4.3
I want to search GTIN option in admin product list. So, for that I am providing GTIN value in ProductLoadAllPaged store procedure. Now, when I search GTIN value from product list at that time throw ...
0
votes
0answers
9 views
EclipseLink Warning - Exception caught when trying to close the query statement
I'm using EclipseLink v2.6.4 with Tomcat (Spring boot app) and getting following exception in the server log. The functionality works fine but looks like a connection leak? I tried to google but do ...
0
votes
0answers
28 views
Can't connect MySQL to my spring boot project (java.sql.SQLException: Access denied for user 'root'@'localhost')
This is my 'application.properties' file
spring.jpa.open-in-view=true
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:mysql://localhost:3306/abbc
spring.datasource.username=root
...
0
votes
3answers
82 views
Hibernate insert fails - java.sql.SQLException: Invalid arguments in call
I'm trying to insert the user object to Oracle with Hibernate. Object is loaded with values entered in the user registration form.
id is @GeneratedValue
pass is @Transient
These are the properties of ...
0
votes
0answers
48 views
TransactionScope - Cannot enlist in the transaction because the transaction has already been committed or rolled back
when I'm trying to execute a test with enlisted transactions sometimes I am receiving the error :
System.Data.SqlClient.SqlException : Cannot enlist in the transaction because the transaction has ...
0
votes
1answer
27 views
SqlExceptionHelper - The column name … was not found in this ResultSet
This is the query:
UPDATE einvoice_message AS e1
SET message = null
FROM (
SELECT *
FROM einvoice_message
where created < :created
ORDER BY :created LIMIT :limit
FOR UPDATE SKIP ...
0
votes
2answers
27 views
How do I resume the execution from the point where the exception was thrown in try/catch block in Java?
My use-case requires me to check the DBConnections to make sure we have the right url in place.
say we have list of 10 Oracle DBs and the connection url of DB4 is malformed. we want to capture that ...
0
votes
1answer
51 views
How to insert values in mysql database if one of the column is auto increment using prepared statement
public String put(){
this.query = "INSERT INTO user_registration VALUES('default', '?' , '?' , '?' , '?' , '?' );";
try {
PreparedStatement stmt= Main.connection....
0
votes
1answer
10 views
Foreign Key violation on ManyToMany with inheritance
Im currently building the following scenario:
I have an Action which holds a list of Parameters. Those can be in other actions as well, so I have a ManyToMany relationship.
The Parameter is an ...
-1
votes
1answer
53 views
Entity Framework Core ExecuteSqlInterpolated gives Microsoft.Data.SqlClient.SqlException
I'm looping over a bunch of tables and have to delete records in each of them having a specific column name. I was able to get that list but the following line gives me the exception: Microsoft.Data....
0
votes
1answer
66 views
MassTransit JobConsumer: (0x80131904): Incorrect syntax near the keyword 'UPDATE'
I try to start MassTransit/Sample-JobConsumer on EntityFramework Core, but having strange error
(0x80131904): Incorrect syntax near the keyword 'UPDATE'
Steps to reproduce:
Clone MassTransit/Sample-...
0
votes
0answers
30 views
C# SqlException (0x80131904): Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction
Stackers, I am getting an exception Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction on the production server for my web application (Asp.Net ...
0
votes
0answers
13 views
LinqToDB.SqlQuery.SqlException: 'Table not found for 't621.t619.Id'.'
When I am running the linq query at that time it shows the topic error i.e. : LinqToDB.SqlQuery.SqlException: 'Table not found for 't621.t619.Id'.'
Here is my linq query
var productSelected = (from ...
0
votes
0answers
26 views
Why I can't use DriverManager.registerDriver;
error
I can't use DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
and connect = DriverManager.getConnection(url, user, password);. when I try to build my application the errors as ...
0
votes
1answer
63 views
C# - Only primitive types or enumeration types are supported in this context
I am trying to make a login page connected to sql server but whenever I enter username and password the next line of code
var user = db.Admins.Where(a => a.username.Equals(usertext))....
0
votes
0answers
28 views
「Mockito: Mock SQLException of mapper that is not defined in interface」
0. Overview :
Framework : Spring boot
Database access : MyBatis
I have 2 layers: service and mapper.
My desire is to mock method of mapper :
purchaseHistoryMapper.addPurchaseHistory(...
0
votes
0answers
58 views
EF Core 3.1.7 using database-first with a composite key relationship results in invalid SQL
I have two tables in SQL InvoiceHeader and InvoiceLines that have a one to many relationship where four columns are used as the foreign key. I have no trouble generating entity objects from the ...
0
votes
0answers
21 views
Catching SQLExceptions with Java and React
I have an app with a React frontend, Spring Boot backend and Oracle DB. I made a trigger which raises a custom exception with a custom number. For some reason I can't display its message in React - ...
0
votes
2answers
127 views
Retry the preparedstatement batches if an exception (SQLException | BatchUpdateException) occurs - Java
I had a situation where my code was getting hit by the deadlock issue with SQL Server for some transactions. So, I implemented a retry logic to overcome the same. Now, I'm facing a new problem. The ...
0
votes
2answers
43 views
SQLException when inserting data into DB
I am trying to insert data but its giving me success message but not inserted to database.I am using netbeans and Xampp. I tried many ways but it always the same.
This is my code:
public AddSeat() {
...
0
votes
0answers
61 views
Group By Clause not working via Postman with Spring Boot
I'm facing an issue with a block of SQL query and group by clause inside it.
I'm using SQL Server 2017 and Spring Boot.
Engagement Model:
@Entity
@Table(name = "engagement")
public class ...
0
votes
0answers
92 views
The network path was not found in windows 7
when I'm running http://localhost/ in my local PC getting this error. But what does it mean?
The network path was not found
Description: An unhandled exception occurred during the execution of the ...
0
votes
0answers
17 views
hql :SQLSyntaxErrorException : Many to Many mapping with in clause
I have 2 entity mapping with inverse join as :
@Entity
@Table(name="app_user")
public class AppUser implements Serializable{
//this is primary key
private Integer id;
@...
0
votes
1answer
56 views
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dllAdditional information
I'm new to C# and windows form. I am still a learner.
In the following code, I am getting System.Data.SqlClient.SqlException at int Result = cmd.ExecuteNonQuery();
this issue also states:
Procedure ...
1
vote
1answer
164 views
How to handle SqlIntegrityConstraintViolationException for Unique Fields?
I'm trying to catch a SQLIntegrityViolationException for a Unique Field called "código", but the catch block is never executed.
This is my code:
@Transactional
public Machine save(Machine ...
0
votes
0answers
118 views
Caused by: java.sql.SQLException: Invalid character encountered in
I am getting an error "Invalid character encountered in" in the query result of a SELECT SQL statement of a table in our client's production database. The SELECT statement is: select * from A_TABLE ...
0
votes
1answer
31 views
java.sql.SQLException: No suitable driver found for jbdc:mysql://localhost:3306/loginDB & java.lang.NullPointerException
I am having a problem where the Eclipse IDE does not recognize the jdbc driver in the .jar file. I have already tried putting it in the build path from WEB-INF/Lib and also the build folder. I have ...
0
votes
1answer
157 views
UCAExc:::5.0.0-SNAPSHOT user lacks privilege or object not found: PERSONSET in statement [UPDATE PersonSET address = 'null ' WHERE name = 'null ']
package jdbcex;
import java.sql.*;
public class JdbcDmlEx {
public static void main(String[] args) {
String[] arr;
arr = new String[3];
try {
Class.forName("net.ucanaccess.jdbc....
1
vote
1answer
77 views
RAISERROR - differences in SQLException behaviour in Java Client
I'm seeing differences in behaviour in how Java handles SQL Server errors thrown by RAISERROR, depending upon what the actual error is, in that:
Unique Constraint Violation: The SQL Exception is ...
0
votes
1answer
172 views
java.sql.SQLException: Invalid Oracle URL specified Error
I am trying to connect Oracle Database with JDBC Driver. I am getting java.sql.SQLException: Invalid Oracle URL specified error. Please help me in resolving the issue.
package test_connection;
...
0
votes
1answer
127 views
ORA-12519 TNS: No appropriate service handler found in JBoss 7.2
I'm migrating some projects from JBoss 6.4 to JBoss 7.2, these projects needs different datasources to configurate DB connections. I added the datasources to the JBoss server config file (standalone....
0
votes
3answers
53 views
Inserting data into a database - SQLException
I'm trying to insert information entered by a user from a Java GUI I made on NetBeans but I keep getting an exception I can't seem to find out what I did wrong. (Database name is student and table is ...
0
votes
0answers
22 views
java.sql.SQLException:No value specifies for paramerter 1
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
try{
Class.forName("com.mysql.jdbc.Driver");
Connection ...
0
votes
1answer
40 views
How to add date to database from java
I am having trouble trying to add dates to my database
This is my code
public void AddStudent(String idStudent, String name, String idClass, String dateOfBirth, String sex, String address){
...
0
votes
0answers
19 views
java.sql.SQLException: Access denied for user 'root@localhost'@'localhost' (using password: YES) in eclipse combined MySql
Please help me solve this error:(I have tried redoing all the coding three times) Still no one could help.
[Split Screen and single screen of MySql and Eclipse][1]
0
votes
0answers
27 views
'1 Connection Error' in student registration form after clicking on registr
In Student Registration when I give input and try to register it shows me message dialog box with:
1 connection error
try relay hard to solve this problem but i can't.
try {
query="insert ...
0
votes
0answers
47 views
SQL Server 2016 LocalDB “No process is on the other end of the pipe”
Our application is using Microsoft's SQL Server 2016 LocalDB. I randomly had a customer call in this morning saying his application wouldn't launch. After validating this, I pulled his database file ...
0
votes
3answers
61 views
How to check the types of Exceptions thrown in a catch block?
I have something like this:
catch (Exception ex)
{
if (ex is "Exception Type")
{
}
else if (ex is SqlException)
{
}
else if
{
...
.....
1
vote
1answer
29 views
Hibernate + MySQL: Could not open connection
I am trying to work with Databases in JAVA.
Therefore I've downloaded MySQL, set a password for my root user and created a schema JH.
The database is running on localhost port 3306.
Now I want to ...
1
vote
1answer
185 views
phpmyadmin EXCEPT SELECT is not usable [SOLVED]
I am trying to use EXCEPT when getting data from 2 tables, but I can not use EXCEPT SELECT.
Phpmyadmin does not recognize EXCEPT and does not allow me to use the 2nd SELECT.
Is there other way i ...
0
votes
0answers
79 views
Timeout Error Sql Exception 0 x 80131904 .Net Core
I'm using .NET Core and trying to figure out why the SQL Server localdb is not working. I am using Dapper to connect to the database and I used breakpoints to check if all the data was there and it ...
0
votes
2answers
48 views
Why does this SQL search give this incompatibility error?
I'm having this error in my project when attempting to search using SQL for a specific name. When I type the name into a textbox and search.
This is the code used:
da = New SqlDataAdapter("...
0
votes
2answers
169 views
InvalidCastException deserializing a SqlException with Newtonsoft.Json
I have an error deserializing a JSON string containing a SqlException instance.
Environment information:
- .NET Core: version 2.2
- Newtonsoft.Json: version 11.0.1
Result Error:
System....