简体   繁体   中英

Apostrophes returned by sql query not being printed in Java

I'm working with Oracle SQL Developer and the queries I execute are well printed in its console, but not in the Java console either in jsp.

  • In debug mode (inspect mode or varibles schede) doesn't even appears the character, it's shown the 2 words together.
  • In the Java console appears as '?'
  • In the JSP as '[0092]'. Could it be encoding issue?

The query is a simple select:

SELECT something, somethingElse FROM myTable where filter = 'someArgument';

This is how I retrieve the value after executeQuery():

  //here is already not being printed. But the jsp shows it as unreadable character.
  resultSet.getObject(i).toString();

This is how I put it in the jsp:

stringBuffer.append("<option value='" 
+ mapEntryElement.getKey() + "'>"+ mapEntryElement.getValue().toString() + "</option>");

I've tried adding this to the JSP but nothing:

<%@ page language="java" contentType="text/html; charset=utf-8" %>

Any idea?

It was bad written in the database. It was an accent instead of apostrophe

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM