Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stmt.setString(1, "a"); // This won't return any records
- conn.prepareStatement("select * from x where c = cast(? as char(4))")
- String sql = "select * from x where c = ?";
- OraclePreparedStatement stmt = (OraclePreparedStatement) conn.prepareStatement(sql);
- stmt.setFixedCHAR(1, "a");
- ...
- I have nice fix for this.You have to add one property while getting connection from database.
- NLS_LANG=american_america.AL32UTF8
- or
- In Java connection you can use below code :
- java.util.Properties info = new java.util.Properties();
- info.put ("user", user);
- info.put ("password",password);
- info.put("fixedString","TRUE");
- info.put("NLS_LANG","american_america.AL32UTF8");
- info.put("SetBigStringTryClob","TRUE");
- String url="jdbc:oracle:thin:@"+serverName;
- log.debug("url="+url);
- log.debug("info="+info);
- Class.forName("oracle.jdbc.OracleDriver");
- conn = DriverManager.getConnection(url,info);
- Thanks,
- Swapna
Add Comment
Please, Sign In to add comment