db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Hillegas (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-7024) Aparece el caracter □ (UNICODE 25A1) al insertar datos DB
Date Thu, 27 Dec 2018 19:02:00 GMT

    [ https://issues.apache.org/jira/browse/DERBY-7024?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16729787#comment-16729787
] 

Rick Hillegas commented on DERBY-7024:
--------------------------------------

I strongly doubt that Derby is corrupting the input value. Examine what is in nextLineMaterias[0]
before you insert it into your table. Print it to the console. Print out the value of nextLineMaterias[0].charAt(0).

Also, for better performance, use a parameterized PreparedStatement to populate your table:

{noformat}
try (PreparedStatement ps = connection.prepareStatement("insert into APP.TBLMATERIAS VALUES(default,?)"))
{
  while ((nextLineMaterias = readerMaterias.readNext()) != null) 
  {
    ps.setString(1, nextLineMaterias);
    ps.executeUpdate();
  }
}
{noformat}

Hope this helps,
-Rick

> Aparece el caracter □ (UNICODE 25A1) al insertar datos DB
> ---------------------------------------------------------
>
>                 Key: DERBY-7024
>                 URL: https://issues.apache.org/jira/browse/DERBY-7024
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.14.2.0
>            Reporter: Jonathan Alvarado Murillo
>            Priority: Major
>
> Hola, tengo datos en un archivo CSV, cuando inserto una línea como insert into APP.TBLMATERIAS
VALUES(default,'Accounting.'), en la salida del NetBeans está bien, pero al momento de insertarse
en la DB me escribe un caracter □ (UNICODE 25A1), por lo tanto mi registro queda □Accounting.,
pero ese caracter no está en la captura de datos del archivo CSV ni en la salida de NetBeans
al hacer el System.out.Print, lo curioso es que sólo lo hace con el primer registro, los
otros registros los inserta correctamente sin ese caracter, esto es un error grave para mi
app porque uso ese dato para una consulta y ejecutar una acción.
> Hello, I have data in a CSV file, when I insert a line as "insert into APP.TBLMATERIAS
VALUES (default, 'Accounting.')", In the output of NetBeans it is fine, but at the moment
of inserting itself into the DB it writes me a character □ (UNICODE 25A1), therefore my
record remains "□ Accounting.", But that character is not in the data capture of the CSV
file or in the output of NetBeans when doing the System.out.Print, the funny thing is that
only do with the first record, the other records insert them correctly without that character,
this is a serious error for my app because I use that field for a query and execute an action.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message