Questions tagged as 'prepared-statements'

1
answer

Postgresql -en Date but the expression is character variable- error inserting?

I want to insert from java in postgresql. By bringing (and casting) a java.util.Date to java.sql.Date , it works fine, but at the time of inserting it, it marks me this:    ERROR: the column "fechab1" is of type date but the expr...
asked by 31.12.2018 / 18:41
1
answer

Error jQuery and Ajax, returns [object Object] of a SQL query

I have an error, and PHP does not return the query sql well. This is what I do: $(document).on('click', '.editarCliente', function () { var idc = $(this).attr("id"); console.log(idc); $.ajax({ type: 'POST', url: 'php/edit...
asked by 17.09.2018 / 21:35
0
answers

I have this error in the execute statement when doing UPDATE: PDOException: SQLSTATE [HY093]: Invalid parameter number:

I come to you because I already exhaust the options. I already checked the answers and none of them answered my problem to see if you see the error ... This is my code: $Clave=$_POST["f_Clave"]; $Cantidad=$_POST["f_Cantidad"]; $Catego...
asked by 03.08.2018 / 20:08
0
answers

Convert java.util.Date to java.sql.Date

I need to do the conversion java.util.Date to java.sql.Date . I have tried the following: private long convertirDate(java.util.Date f1) { java.sql.Date fechaSalida = new java.sql.Date(f1.getTimeInMillis()); } The problem is...
asked by 15.07.2018 / 19:52
1
answer

Problems with the preparedStatement

Thanks for your attention I would like to ask what the problem is in my code, I am doing a query with Java but when going to the preparedStatement it tells me that the connection is closed and can not execute any more operations (MySQLNonTransie...
asked by 05.06.2018 / 19:04
0
answers

java- How to use PreparedStatement correctly?

It turns out that I am trying to parameterize a querie , apparently it takes the data but returns an erroneous result for example. Select campo from tabla where nombre ='pepito' Does not return anything select campo from tabla whe...
asked by 29.05.2018 / 17:07
0
answers

-Java Can you parameterize a column with preparedStatement?

I have a dropdown that when the user selects it, he asks for a column of one db. The problem is that I can do SQLinyection with the same options. Next to the dropdown I have a field that also queries the db but it is parametrized, I wanted to kn...
asked by 29.05.2018 / 17:57
2
answers

ResultSet error "Can not find symbol"

I recently worked with a code that connects to a database in mysql. Its functionality is to insert data to the previously created table and then with a button to give functionality to empty TxtField in Jframe to refill. The error is shown to...
asked by 15.05.2018 / 08:17
1
answer

PreparedStatement does not insert data

Good afternoon: I request the collaboration to solve the following problem that I have with two files in java, one is called test and the other connections, the test file has a table that brings the data from the mysql database and with a click...
asked by 07.02.2018 / 20:08
0
answers

How to use a prepared statement from mysql in WPF

I am adding columns dynamically from rows with the following prepared statement in mysql. SET @sql = null; SELECT GROUP_CONCAT(DISTINCT CONCAT( 'SUM(IF(PC.id_competencia=' ,PC.id_competencia ,',PC.puntaje,0) ) AS P...
asked by 09.01.2018 / 00:23