Unicode in string literals

Hi,
Some unicode characters are refusing to be 'escaped' when placed into a string literal.
For example, "\u1fff" results in the 5 char long string "u1fff" - the backslash is stripped and that's it.
There appear to be many other characters that also behave like this.
Anyone know what's up with this? Are such chars illegal or something?
Is there any list of these chars?
Bye!
Mark

I don't think Unicode 1FFF exists (it's blank). For example 1FF2 does exist and works fine:
textfield.text = "\u1ff2";
// you get ῲ
Kenneth Kawamoto
http://www.materiaprima.co.uk/

Similar Messages

  • Error SQL70015: Error validating element [dbo].[GetDocument]: Deprecated feature 'String literals as column aliases' is not supported

    Using MS SQL Management Studio 2012 attempting to export (from GoDaddy) a .bacpac database for import to Azure and get the error message listed in the Title (String literals as column aliases is not supported on SQL Azure). There was a discussion of this
    problem in mid-2013, but it ended with saying that this was a bug with Azure validation, but had been fixed and did not require rewriting of databases. Anyone with a clue how to successfully export/import around this?

    Hello,
    A string enclosed in quotation marks used as a column alias for an expression in a SELECT list is not support in Windows Azure SQL database. Please use "expression [AS] column_alias" instead of " 'string_alias' = expression ".
    In your case, you can try to create an application with in SSDT and use Schema Compare to filter out and fixed incompatible objects, and then deploy the database to Windows Azure SQL database.
    Reference:
    Use SQL Server Data Tools to Migrate a Database to Azure SQL Database
    Migrating a Database to SQL Azure using SSDT
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • What is the Quoting Mechanism for String Literals?

    Oracle 10G enterprise edition
    Hi all,
    I am trying to use the new feature support for string literals in 10G.but unfortunately it returns an error. Is there any settings to be done to get implemented with this feature?
    BEGIN
    DBMS_OUTPUT.put_line ('This is ram''s string!');
    DBMS_OUTPUT.put_line(q'[This is ram's string!]');
    END;
    ERROR:
    ORA-01756: quoted string not properly terminated
    Thanks
    Ram

    Art in oracle wrote:
    Oracle 10G enterprise editionAre you sure you are using 10g? (which version?)
    It works ok for me... (10.2.0.1)
    SQL> select q'[This is fred's quoted string]' from dual;
    Q'[THISISFRED'SQUOTEDSTRING]
    This is fred's quoted string
    SQL> set serveroutput on
    SQL> ed
    Wrote file afiedt.buf
      1  BEGIN
      2   DBMS_OUTPUT.put_line ('This is ram''s string!');
      3   DBMS_OUTPUT.put_line(q'[This is ram's string!]');
      4* END;
    SQL> /
    This is ram's string!
    This is ram's string!
    PL/SQL procedure successfully completed.
    SQL>

  • Small clarification in String literals

    Hi
    System.out.print((hello == ("Hel"+"lo")) + " "); Returns "TRUE"
    Reason:Strings computed by constant expressions compile time and then treated as if they were literals.
    Is it true?String Literal memory allocation at compile time or runtime?
    Thanks
    **smile

    AmarKamat wrote:
    Works differently if any part of the concatenation is a variable.Can you explain this in more detail or provide some more pointers?If any part of what's being concatenated is not a compile-time constant, then rather than producing a single literal that goes into the pool, the compiler produces code to execute at runtime that builds up the string using StringBuilder.append or StriingBuffer.append of some combination of runtime expressions and String literals, depending on what the specific pieces are. You can use javap to see the generated bytecode.

  • Converting String to unicode encoded string

    Hi,
    I would like to convert non-ascii characters in a String or the whole string to unicode encoded character.
    For example:
    If i have some japanese character, I would like it to be converted to /uxxxx
    How can i do this? I don't want the exact character, as I am able to get that using getBytes("encoding format"). All i want is code point representation of the non ascii unicode characters.
    Any help to do this will be appreciated.
    Thanks in advance.

    I tried to do what that but I am not sure whether that is right or not.
    String inputStr = "some non ascii string";
    char[] charArray = inputStr.toCharArray();
    int code;
    StringBuffer sb = new StringBuffer();
    for(int i = 0; i < charArray.length; i++)
    code = (int) charArray;
    String hexString = Integer.toHexString( code );
    sb.append(hexString);
    System.out.println("Code point is "+sb.toString());
    My above code does not work as expected. Could you please tell me where i am goofing?
    Thanks!

  • Unicode to String Conversion

    Dear all,
    I'm trying to get the String from unicode, previously i'm converting the String to Unicode like below,
    String s = "\\u"+Integer.toHexString(s.charAt(0));
    Which is giving me the same what i appended above even after Conversion using UTF-8.
    If i do String s ="\u30f3"
    It is giving me correct character. But my problem is i'm getting the latter part i.e hexString latter in the run time...through Integer.toHexString..
    i can't add this as a character.. so it is taking as a two different strings..
    How to handle this situation..
    Hope i can find the answer,
    Thanks in advance,
    Srinivas N

    Below is my IOUtils class. In particular, see the loadTextFile method for an example of how to read a UTF file, and the isUTF method to detect if a file is Unicode
    You will not be able to compile this class unless you have my InfoFetcher class. You should be able to find a reference to this class by searching google for "InfoFetcher tjacobs01"
    You are welcome to use and modify this class, but please don't change the package or take credit for it as your own work
    package tjacobs.io;
    import java.awt.Component;
    import java.io.*;
    import java.net.URL;
    import java.net.URLConnection;
    import java.text.MessageFormat;
    import java.util.ArrayList;
    import java.util.List;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    import javax.swing.JOptionPane;
    import javax.swing.JTable;
    import javax.swing.table.TableModel;
    import tjacobs.io.InfoFetcher.FetcherListener;
    * IOUtils class
    * This is an important class that I use a lot.<p>
    * has a lot of static utilities. Most should be fairly self-explanatory
    public class IOUtils {
         public static final int DEFAULT_BUFFER_SIZE = (int) Math.pow(2, 20); //1 MByte
         public static final int DEFAULT_WAIT_TIME = 30000;
         public static final boolean ALWAYS_BACKUP = false;
         public static String loadTextFile(File f) throws IOException {
              return loadTextFile(f, isUTF16(f));
         public static String loadTextFile(File f, boolean UTF16) throws IOException {
              BufferedReader br = !UTF16 ?
                        new BufferedReader(new FileReader(f)) :
                        new BufferedReader(
                             new InputStreamReader(new FileInputStream(f),
                                                   "UTF-16"));
              int length = (int) f.length();
              char data[] = new char[!UTF16?(int)length : ((int)length) / 2 - 1];
              int got = 0;
              do {
                   got += br.read(data, got, data.length - got);
              while (got < data.length);
              return new String(data);
         public static InfoFetcher loadData(InputStream in) {
              byte buf[] = new byte[DEFAULT_BUFFER_SIZE]; // 1 MByte
              return loadData(in, buf);
         public static InfoFetcher loadData(InputStream in, byte buf[]) {
              return loadData(in, buf, TimeOut.DEFAULT_WAIT_TIME);
         public static InfoFetcher loadData(InputStream in, byte buf[], int waitTime) {
              return new InfoFetcher(in, buf, waitTime);
         public static InfoFetcher loadData(InputStream in, int initBufLength, int waitTime) {
              return loadData(in, new byte[initBufLength], waitTime);
         public static InfoFetcher loadData(File f) throws FileNotFoundException{
              //if (!f.exists()) throw new FileNotFoundException(f.getAbsolutePath());
              //create the inputstream first so that we can generate the FileNotFoundException right away
              InputStream in = new BufferedInputStream(new FileInputStream(f));
              long len = f.length();
              if (len > Integer.MAX_VALUE) {
                   throw new RuntimeException("File size exceeds maximum size for a byte buffer");
              return loadData(in, (int) len, TimeOut.NO_TIMEOUT);
         public static InfoFetcher loadData(URL url) throws IOException{
              return loadData(url.openConnection());
         public static InfoFetcher loadData(URLConnection conn) throws IOException {
              int size = conn.getContentLength();
              if (size < 0) return loadData(conn.getInputStream(), 2000, DEFAULT_WAIT_TIME);
              return loadData(conn.getInputStream(), size, DEFAULT_WAIT_TIME);
          * Note: There is no guarentee that this method will
          * ever return. For instance, if you call loadAll on
          * an open socket connection it won't return until the
          * socket has closed
         public static String loadAllString(InputStream in) {
              InfoFetcher fetcher = loadData(in);
              fetcher.run();
              return new String(fetcher.buf, 0, fetcher.got);
          * Note: There is no guarentee that this method will
          * ever return. For instance, if you call loadAll on
          * an open socket connection it won't return until the
          * socket has closed
         public static byte[] loadAll(InputStream in) {
              InfoFetcher fetcher = loadData(in);
              return fetcher.readCompletely();
         public static void copyBufs(byte src[], byte target[]) {
              int length = Math.min(src.length, target.length);
              for (int i = 0; i < length; i++) {
                   target[i] = src;
         * Not threaded by default. If you need this to run
         * in a separate, create a new thread or runnable class
         * @param in
         * @param out
         public static void pipe (InputStream in, OutputStream out) {
              pipe (in, out, TimeOut.NO_TIMEOUT);
         * Not threaded by default. If you need this to run
         * in a separate, create a new thread or runnable class
         * @param in
         * @param out
         public static void pipe (InputStream in, final OutputStream out, int timeout) {
              pipe (in, out, timeout, false);
         private static class PipeFetcher implements FetcherListener {
              OutputStream out;
              InputStream in;
              public IOException ex;
              boolean closeWhenDone;
              public PipeFetcher (InputStream in, OutputStream out, boolean closeWhenDone) {
                   this.out = out;
                   this.closeWhenDone = closeWhenDone;
              public void fetchedMore(byte[] buf, int start, int end) {
                   try {
                        out.write(buf, start, end - start);
                   catch (IOException iox) {
                        ex = iox;
                        try {
                             in.close();
                             out.close();
                        catch (IOException iox2) {
                             iox2.printStackTrace();
              public void fetchedAll(byte[] buf) {
                   if (closeWhenDone) {
                        try {
                             out.close();
                        catch (IOException iox) {
                             iox.printStackTrace();
         * Not threaded by default. If you need this to run
         * in a separate, create a new thread or runnable class
         * @param in
         * @param out
         public static IOException pipe (final InputStream in, final OutputStream out, int timeout, final boolean closeWhenDone) {
              InfoFetcher info = new InfoFetcher (in, new byte[DEFAULT_BUFFER_SIZE], timeout);
              PipeFetcher pf = new PipeFetcher(in, out, closeWhenDone);
              info.addFetcherListener(pf);
              info.run();
              return pf.ex;
              info.addInputStreamListener(new InputStreamListener() {
                   public void gotMore(InputStreamEvent ev) {
                        try {
                             out.write(ev.getBytes(), ev.getStart(), ev.getBytesRetrieved() - ev.getStart());
                        catch (IOException iox) {
                             System.err.println ("Pipe closing");
                   public void gotAll(InputStreamEvent ev) {}
              Thread t= new Thread (info);
              t.start();
         public static byte[] expandBuf(byte array[]) {
              return expandBuf(array, array.length * 2);
         public static byte[] expandBuf(byte array[], int newlength) {
              byte newbuf[] = new byte[newlength];
              copyBufs(array, newbuf);
              return newbuf;
         public static byte[] trimBuf(byte[] array, int size) {
              byte[] newbuf = new byte[size];
              for (int i = 0; i < size; i++) {
                   newbuf[i] = array[i];
              return newbuf;
         * @see getFileOutputStream(File, boolean)
         public static OutputStream getFileOutputStream(File file) throws IOException {
              return getFileOutputStream(file, true);
         * Convienience method for opening a FileOutputStream w/wo a buffer
         * makes sure that the file directory exists so this should always succeed.
         public static OutputStream getFileOutputStream(File file, boolean buffered) throws IOException {
              if (!file.exists() && !file.isDirectory()) {
                   confirmDirectoryExists(file.getParentFile());
              if (file.exists()) {
                   if (ALWAYS_BACKUP) {
                        file.renameTo(new File(file.getAbsolutePath() + "~"));
                   } else {
                        file.delete();
              file.createNewFile();
              OutputStream out = new FileOutputStream(file);
              if (buffered) {
                   out = new BufferedOutputStream(out);
              return out;
         * Confirms that a directory exists and makes it if it doesn't
         public static void confirmDirectoryExists(File dir) {
              if (!dir.exists()) {
                   confirmDirectoryExists(dir.getParentFile());
                   dir.mkdir();
              if (!dir.isDirectory()) {
                   confirmDirectoryExists(dir.getParentFile());
         public static OutputStream getFileOutputStream(String name) throws IOException {
              return getFileOutputStream(name, true);
         public static PrintStream getFilePrintStream(String file) throws IOException {
              return new PrintStream(getFileOutputStream(file));
         public static PrintStream getFilePrintStream(File file) throws IOException {
              return new PrintStream(getFileOutputStream(file));
         public static OutputStream getFileOutputStream(String name, boolean buffered) throws IOException {
              return getFileOutputStream(new File(name), buffered);
         * @param f if f is a directory it returns the absolue path to f otherwise it returns the absolute path to the directory f is in
         public static String getDirectory(File f) {
              if (f.isDirectory()) {
                   return f.getAbsolutePath();
              else {
                   return f.getParentFile().getAbsolutePath();
         * Get the file without the extension.
         * @see getFileNoExtension(String);
         public static String getFilenameNoExtension(File f) {
              return getFilenameNoExtension(f.getName());
         * Gets the file name without the extension
         * returns the whole file name if no '.' is found<br>
         * otherwise returns whatever's before the last .
         public static String getFilenameNoExtension(String s) {
              int idx = s.indexOf('.');
              if (idx == -1) {
                   return s;
              else {
                   return s.substring(0, idx);
         * gets the file extension
         * if a '.' character is found it returns what's after the last .
         * if not, it returns the empty string
         public static String getFileExtension(String s) {
              int idx = s.lastIndexOf('.');
              if (idx == -1) {
                   return "";
              else {
                   return s.substring(idx + 1);
         * @see getFileExtension(String)
         public static String getFileExtension(File f) {
              return getFileExtension(f.getName());
         * Delete everything in a directory. Recursively deletes all sub-directories
         public static void deleteDirectory (File f, Component parent) {
              if (!f.isDirectory()) {
                   throw new RuntimeException("File " + f.getAbsolutePath() + " is not a directory!");
              int val = JOptionPane.showConfirmDialog(parent, "Confirm Delete " + f.getAbsolutePath(), "Confirm Delete " + f.getAbsolutePath(), JOptionPane.OK_CANCEL_OPTION);
              if (val == JOptionPane.OK_OPTION) {
                   deleteAllFiles(f);
         private static void deleteAllFiles (File f) {
              //recursively delete all its contents
              if (!f.isDirectory()) {
                   //throw new RuntimeException("File " + f.getAbsolutePath() + " is not a directory!");
                   f.delete();
              else {
                   File[] files = f.listFiles();
                   for (int i = 0; i < files.length; i++) {
                        if (files[i].equals(f) || files[i].equals(f.getParent())) {
                             continue;
                        deleteAllFiles(files[i]);
                   f.delete();
         * static utility method for copying a file to another location
         public static void copyFile (File src, File newParent) throws FileNotFoundException {
              if (!src.exists()) {
                   return;
              if (!newParent.exists()) {
                   newParent.mkdirs();
                   //throw new RuntimeException("Parent folder must exist");
              if (newParent.isDirectory()) {
                   File newFile = new File(newParent, src.getName());
                   if (src.isDirectory()) {
                        newFile.mkdir();
                        File children[] = src.listFiles();
                        for (int i = 0; i < children.length; i++) {
                             copyFile(children[i], newFile);
                   else {
                        //loadFile
                        InfoFetcher info = loadData(new FileInputStream(src));
                        final BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(newFile));
                        info.addInputStreamListener(new InputStreamListener() {
                             int lastbytes = 0;
                             public void gotMore(InputStreamEvent ev1) {
                                  try {
                                       out.write(ev1.getBytes(), lastbytes, ev1.getBytesRetrieved() - lastbytes);
                                       lastbytes = ev1.getBytesRetrieved();
                                  catch (IOException iox) {
                                       iox.printStackTrace();
                             public void gotAll(InputStreamEvent ev2) {
         * @deprecated use the Find class
         public static File find(Pattern p, File start) {
              return recursiveFind(start, null, p, true);
         * @deprecated use the Find class
         public static File find(Pattern p) {
              return find(p, new File("."));
         * @deprecated use the Find class
         private static File recursiveFind(File current, File cameFrom, Pattern p, boolean startDescending) {
              Matcher m = p.matcher(current.getName());
              if (m.matches()) {
                   return current;
              File[] files = current.listFiles();
              if (startDescending) {
                   File value = descend(current, cameFrom, p, startDescending);
                   if (value != null) return value;
                   return ascend(current, cameFrom, p, startDescending);
              else {
                   File value = ascend(current, cameFrom, p, startDescending);
                   if (value != null) return value;
                   return descend(current, cameFrom, p, startDescending);               
         * @deprecated use the Find class
         private static File ascend(File current, File cameFrom, Pattern p, boolean startDescending) {
              File par = current.getParentFile();
              if (par == null) {
                   return null;
              par = par.getAbsoluteFile();
              if (par.equals(cameFrom)) {
                   return null;
              return recursiveFind(par, current, p, false);
         * @deprecated use the Find class
         private static File descend(File current, File cameFrom, Pattern p, boolean startDescending) {
              File files[] = current.listFiles();
              if (files == null) {
                   return null;
              for (int i = 0; i < files.length; i++) {
                   File child = files[i];
                   if (child.equals(cameFrom)) {
                        continue;
                   File f = recursiveFind(child, current, p, true);
                   if (f != null) {
                        return f;
              return null;
         * Utility for saving a string to a file. Rather than have to set
         * up all the writers etc and trap exceptions, just returns a boolean
         * if it worked
         * <p>
         * @see saveData(File, byte[])
         public static boolean saveData(File f, String s) {
              return saveData(f, s.getBytes());
         * Utility for saving a string to a file. Rather than have to set
         * up all the writers etc and trap exceptions, just returns a boolean
         * if it worked
         public static boolean saveData(File f, byte[] data) {
              try {
                   OutputStream out = new BufferedOutputStream(new FileOutputStream(f));
                   out.write(data);
                   out.close();
              catch(IOException iox) {
                   iox.printStackTrace();
                   return false;
              return true;
         * Way to save a stream to a file. Not multithreaded.
         * Will block until the save is done
         * @param f
         * @param in
         * @return
         public static boolean saveData(File f, InputStream in) throws FileNotFoundException {
              return pipe(in, new FileOutputStream(f), TimeOut.NO_TIMEOUT, true) == null;
              //InfoFetcher fetcher = loadData(in);
    //          try {
    //               FileOutputStream out = new FileOutputStream(f);
    //               fetcher.addFetcherListener(new FetcherListener() {
    //                    public void fetchedMore(byte[] buf, int start, int end) {
    //                    public void fetchedAll(byte[] buf) {
    //          } catch (IOException iox) {
    //               iox.printStackTrace();
    //               return false;
    //          return true;
         * @deprecated use Find
         public static List<File> findAllFiles(Pattern p) {
              ArrayList<File> l = new ArrayList<File>();
              //File start = File.listRoots()[0];
              File start = new File("C:\\");
              return recursiveFindAll(start, null, p, true, l, 0);
              //l;
         * @deprecated use Find
         private static List recursiveFindAll(File current, File cameFrom, Pattern p, boolean startDescending, ArrayList<File> list, int level) {
              //System.out.println("" + level + " Scanning: " + current + "par: " + cameFrom);
              System.out.println("Scanning: " + current);
              Matcher m = p.matcher(current.getName());
              if (current.getName().equals("C:\\")) {
                   System.out.println("root");
                   try {
                        System.in.read();
                   catch (IOException iox) {}
              if (m.matches()) {
                   //return current;
                   list.add(current);
                   System.out.println("Adding " + current);
              File[] files = current.listFiles();
              if (startDescending) {
                   //File value = descend(current, cameFrom, p, startDescending);
                   descendAll(current, cameFrom, p, startDescending, list, level + 1);
                   //ascendAll(current, cameFrom, p, startDescending, list, level + 1);
                   //if (value != null) return value;
                   //return ascend(current, cameFrom, p, startDescending);
              else {
                   //ascendAll(current, cameFrom, p, startDescending, list, level + 1);
                   descendAll(current, cameFrom, p, startDescending, list, level + 1);
                   //File value = ascend(current, cameFrom, p, startDescending);
                   //if (value != null) return value;
                   //return descend(current, cameFrom, p, startDescending);               
              return list;
         * @deprecated use Find
         private static List ascendAll(File current, File cameFrom, Pattern p, boolean startDescending, ArrayList<File> list, int level) {
              File par = current.getParentFile();
              if (par == null) {
                   return list;
              par = par.getAbsoluteFile();
              if (par.equals(cameFrom)) {
                   return list;
              recursiveFindAll(par, current, p, false, list, level);
              return list;
         * @deprecated use Find
         private static File descendAll(File current, File cameFrom, Pattern p, boolean startDescending, ArrayList<File> list, int level) {
              File files[] = current.listFiles();
              if (files == null) {
                   return null;
              for (int i = 0; i < files.length; i++) {
                   File child = files[i];
                   if (child.equals(cameFrom)) {
                        continue;
                   recursiveFindAll(child, current, p, true, list, level);
              return null;
         public File getUniqueName(File f) {
              return getUniqueName (f, new MessageFormat("~{0,number,integer}"));
         public String getNameWOExtension(File f, boolean useAbsolute) {
              int idx = f.getName().indexOf(".");
              return (idx == -1) ? (useAbsolute ? f.getAbsolutePath() : f.getName()) : (useAbsolute ? f.getAbsolutePath() : f.getName()).substring(0, (useAbsolute ? f.getAbsolutePath().lastIndexOf(".") : f.getName().lastIndexOf(".")));
         public String getFileType (File f, boolean includeDot) {
              int idx = f.getName().lastIndexOf(".");
              return idx == -1 ? "" : f.getName().substring(idx + (includeDot ? 0 : 1));
         public File getUniqueName(File f, MessageFormat format) {
              String base = getNameWOExtension(f, true);
              String extension = getFileType(f, true);
              int count = 0;
              while (f.exists()) {
                   count++;
                   f = new File (base + format.format(new Object[] {Integer.valueOf(count)}) + extension);
              return f;
         public static boolean isUTF16 (File f) throws IOException {
              FileInputStream in = null;
              try {
                   if (!f.exists() || f.length() < 2) return false;
                   in = new FileInputStream(f);
                   byte b = (byte)in.read();
                   if (!(b == -1)) return false;
                   b = (byte) in.read();
                   return b == -2;
              finally {
                   if (in != null) in.close();
         public static boolean isUTF16(PushbackInputStream in) {
              boolean got1 = false, got2 = false;
              byte b = 0, b2 = 0;
              try {
                   b = (byte)in.read();
                   got1 = true;
                   if (!(b == -1 || b== -2)) {
                        return false;
                   b2 = (byte) in.read();
                   got2 = true;
                   return b == -1 ? b2 == -2 : b2 == -1;
              catch (IOException iox) {
                   iox.printStackTrace();
              finally {
                   try {
                        if (got1) {
                             in.unread(b);
                        if (got2) {
                             in.unread(b2);
                   } catch (IOException iox) {
                        iox.printStackTrace();
              return false;
         public void saveJTableToCSV(JTable table, File f) throws IOException {
              if (table == null || f == null) return;
              TableModel model = table.getModel();
              if (model == null) return;
              int rows = model.getRowCount();
              int columns = model.getColumnCount();
              PrintWriter pw = new PrintWriter(new FileWriter(f));
              for (int i = 0; i < rows; i++) {
                   for (int j = 0; j < columns; j++) {
                        Object o = model.getValueAt(i, j);
                        pw.print(o.toString());
                        if (j != columns - 1) {
                             pw.print(",");
                   pw.println();
         public static String getPathRelativeTo(File path, File relativeTo) {
              return getPathRelativeTo(path.getAbsolutePath(), relativeTo.getAbsolutePath());
         public static String getPathRelativeTo(String path, String relativeTo) {
              if (!path.startsWith(relativeTo)) return null;
              path = path.substring(relativeTo.length());
              if (path.startsWith(File.separator)) path = path.substring(File.separator.length());
              return path;

  • Problems with string literals in ejb-ql's

    I have a couple EJB-QL's that look like:
    <![CDATA[SELECT OBJECT(o) FROM AssignedStatus AS o WHERE o.recipientID = ?1 AND o.statusID = ?2 AND o.state <> 'r']]>
    which used to work in Orion without a problem but in OC4J I get the following errors:
    com/sun/ejb/ejbql/StringLiteral
    EJB QL statement : 'SELECT OBJECT(o) FROM AssignedStatus AS o WHERE o.recipientID = ?1 AND o.statusID = ?2 AND o.state <> 'r'
    EJB QL method : public abstract com.mongoosetech.reputation.ejb_entity.AssignedStatus com.mongoosetech.reputation.ejb_enti
    ty.AssignedStatusHome.findByRecipientIDAndStatusIDNotRevoked(java.lang.String,java.lang.String) throws javax.ejb.FinderExcept
    ion,java.rmi.RemoteException
    at com.sun.ejb.ejbql.parser.EjbQLParser.parse(EjbQLParser.java:226)
    at com.sun.ejb.ejbql.EjbQLDriver.parse(EjbQLDriver.java:86)
    at com.sun.ejb.sqlgen.SQLGenerator.generateSQLForEjbQLQueries(SQLGenerator.java:628)
    at com.sun.ejb.sqlgen.SQLGenerator.generateSQL(SQLGenerator.java:270)
    at com.evermind.server.ejb.deployment.EJBPackage.init(EJBPackage.java:1947)
    at com.evermind.server.ServerComponent.init(ServerComponent.java:199)
    at com.evermind.server.ejb.EJBPackageDeployment.getPackage(EJBPackageDeployment.java:645)
    at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:513)
    at com.evermind.server.Application.postInit(Application.java:429)
    at com.evermind.server.Application.setConfig(Application.java:136)
    at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1479)
    at com.evermind.server.ApplicationServer.initializeApplications(ApplicationServer.java:1436)
    at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1099)
    at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:93)
    at java.lang.Thread.run(Thread.java:479)
    at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:49)
    Error in application ACME Portal: Error loading package at file:/C:/dev/staging/portalstudio/ee/image/deploy/portal/portal-ej
    b.jar, Failure to initialize EJBQL descriptors: com/sun/ejb/ejbql/StringLiteral
    EJB QL statement : 'SELECT OBJECT(o) FROM AssignedStatus AS o WHERE o.recipientID = ?1 AND o.statusID = ?2 AND o.state <> 'r'
    EJB QL method : public abstract com.mongoosetech.reputation.ejb_entity.AssignedStatus com.mongoosetech.reputation.ejb_enti
    ty.AssignedStatusHome.findByRecipientIDAndStatusIDNotRevoked(java.lang.String,java.lang.String) throws javax.ejb.FinderExcept
    ion,java.rmi.RemoteException
    Am I doing something wrong here? These QL's work in several other App Servers so I am lost as to why this doesn't work.

    Kevin,
    We are aware of this bug in the developer's preview and will be fixed when next version of OC4J 9.0.3 will be released.
    regards
    Debu Panda
    Oracle

  • SPARQL query through Jena adaptor not work when string literals used

    Hi,
    When I executed the following SPARQL query through Oracle Jena adaptor:
    SELECT ?personHasFirstName WHERE
    {?personHasFirstName foaf:firstName ?name . }
    I got the expected results.
    However it won't return anything when I narrowed the query to match a particular name like below:
    SELECT ?personHasFirstName WHERE
    {?personHasFirstName foaf:firstName \"Julie\" . }
    I also tried the Filter approach:
    SELECT ?personHasFirstName WHERE {?personHasFirstName foaf:firstName ?name . FILTER (?name =\"Julie\") }
    It still doesn't return any results.
    I saw from the release notes about the bug dealing with "\". My guess is that the above behavior is caused by that bug. What is the suggested way to walk-around this? Thanks,
    Weihua

    Could you please try this? It works as expected on my machine.
    GraphOracleSem graph = new GraphOracleSem( oracle, modelName);
    ModelOracleSem model = new ModelOracleSem(graph);
    Node sub = Node.createURI("http://test.com/employee123");
    Node pre = Node.createURI("http://xmlns.com/foaf/0.1/firstName");
    Node obj = Node.createLiteral("Julie");
    graph.add(Triple.create(sub, pre, obj));
    String queryString =
    " PREFIX foaf: <http://xmlns.com/foaf/0.1/> " +
    "SELECT ?person WHERE { ?person foaf:firstName \"Julie\" . } ";
    QueryExecution qexec = QueryExecutionFactory.create(
    QueryFactory.create(queryString), model);
    try {
    ResultSet results = qexec.execSelect();
    while (results.hasNext()) {
    QuerySolution soln = results.nextSolution();
    psOut.println("runQuery: soln " + soln);
    finally {
    if (qexec != null)
    qexec.close();
    output snippet:
    runQuery: soln ( ?person = <http://test.com/employee123> )

  • 16-bit string literals

    How can you specify a string literal that compiles to an array of 16-bit units? "string" compiles to 1-byte char* and L"string" compiles to 4-byte wchar_t but we need a syntax to specify a string of 2-byte unsigned short.

    I'm reasonably confident that there is no 16-bit driver that works with an 8i client. I'd suspect that the old 16-bit drivers can probably be used to connect to an 8i database from an older client.
    Justin

  • String literals in Actionscript missing characters?

    I'm putting together a gallery/info viewer in Flash for a fraternity I'm in. What I have it doing is:
    -A thumbnail of each member's picture is visible
    -When the thumbnail is clicked, a picture is called into a UILoader at the top of the screen, and a string is called to be placed into a dynamic textbox next to the UILoader.
    Here's the code for my thumbnail...
    (currentData.currentPic is the location for the UILoader)
    myLastName.addEventListener(MouseEvent.CLICK, myLastNameLoad);
    function myLastNameLoad(e:Event){
        currentData.currentPic.source = "../NewSinfonia/myLastName.jpg";
        infoText.text = "First Last \n  Initiated Fall 10 \n Saxophone Performance '13 \n Webmaster";
    And here's what I get when I click on the thumbnail in the movie preview or when I open it in HTML in Firefox:
    First Last
    nitiated Fall
    Saxophone Performance
    Webmaster
    So, random characters are missing, and the same characters (by which I mean the I in Initiated, both years, etc., not the 10th character or whatever) are missing throughout all forty-or-so thumbnails. Everything else (picture loading, etc.) is working fine. I'm working out of "the official training workbook from Adobe Systems" for guidance, and the example they had similar to this involved pulling .txt files to load into the box, which I can do if I need to, but I'd rather just keep it this way. Anyone have any ideas? All help is appreciated.

    click on your textfields (to select them) and in the properties panel click the embed button:
    http://help.adobe.com/en_US/flash/cs/using/WSb03e830bd6f770ee21a3597d124daee0526-8000.html

  • How to embed string literals in pl/sql?

    DECLARE
    message varchar2(50) := ''That''s tutorialspoint.com!'';
    BEGIN
    dbms_output.put_line(message);
    END;
    I have to get out put like this below but when am trying to do so it is not displaying any output ....plz suggest what might be wrong in this code?
    output
    That's tutorialspoint.com!

    Dsrc00 wrote:
    DECLARE
    message varchar2(50) := 'That''s tutorialspoint.com!';    /*modified*/
    BEGIN
    dbms_output.put_line(message);
    END;
    I have to get out put like this below but when am trying to do so it is not displaying any output ....plz suggest what might be wrong in this code?
    output
    That's tutorialspoint.com!
    Hi,
    Single quote you have to put at the begining and the end of a string.

  • How does Java Handle String Literals Setting to Null for Identical Values ?

    Suppose,
    String s1="Java";
    String s2="Java";
    Now if i am not wrong only one value(bit pattern) "Java" exists in the heap and both s1 and s2 are pointing to it.
    If i set s1 to null,
    s1=null;
    Won't s2 be affected (it is not getting affected actually..)
    What could be the cause for this ?
    Thanks in Advance.

    amtidumpti wrote:
    So is it something like ....
    Variable         Memory Address   Value
    s1                      0234234           "Java"
    s2                      0234235           "Java"
    is s1 is set to null :
    Variable         Memory Address   Value
    s1                      0234234           null
    s2                      0234235           "Java"
    No. In your model here, a variable's value is a String object. It's as if your entire house exists on my s1 paper, and an exact duplicate house with all the same contents exists on my s2 paper. In Java, no variable or expression ever holds an object. No value is ever an object.
    It's more like this:
    Variable         Memory Address         Value
    s1                      0234234           11223344
    s2                      0234235           11223344
    is s1 is set to null :
    Variable         Memory Address         Value
    s1                      0234234           null
    s2                      0234235           11223344and 11223344 is, roughly speaking, the "address" where the String object holding "Java" is stored.
    And in both your model and mine, "Memory Address" is not the address that the variable holds. Rather, it is the address that corresponds to what we humans have named s1 and s2 for our convenience.
    Edited by: jverd on Apr 10, 2009 11:43 AM

  • Searching for String literals in a ResultSet

    Hi! I am currently working in a little project in which one functionallity should be the possibility to search for customers over a special dialog. This dialog consists of a JTextField and a JTable. Now when the user enters e.g. 'a' in the textfield all the customers which include an 'a' at the beginning of their name should be displayed in the JTable. When the user enters a 'b' addtionally all users which fit the condition 'ab' are shown. Currently I requery the DB every time a key is pressed. But this is not very performant over the network. Is there a way to store a buffered ResultSet in RAM and make queries on this ResultSet?
    Thx

    ...but there must be a easier way to deal with it!Either you have all the data in the GUI or you don't. If you have it there then you have to get all of it. And then do something with it. If you don't get it all, then you are going to have to do a query each time. There is no other solution.
    You could do a partial solution, for example do the first query after they type the first letter and then after that handle the data yourself.
    (Keep in mind that this sort of GUI is 'really cool' but generally serves no pratical purpose particularily for large businesses. Day to day work doesn't support such usage.)

  • LTRIM RTRIM not working for unicode char string in SQL 2005

    select len(ltrim(rtrim('メタルワン IFR 12/06 13/05 国際Ⅰ ')))

    Could you try by getting rid of other filters in the WHERE caluse ? get rid of the ; 
    AND Active_bt = 1 AND EngagementStatus_txt = 'O'
    from the query and try .
    As per one of the replies here, try to see if the space is really a space or some special character by checking its ascii value.
    If this is not working, please share your schema structure, with scripts to populate the sample data into it. Please take a look at my test below ;
    CREATE TABLE #test
    (Eng_id INT,
    EngagementId_txt NVARCHAR(90),
    EngagementName_txt NVARCHAR(90),
    EngagementStatus_txt NVARCHAR(1))
    INSERT INTO #test
    SELECT 20,'15614483','メタルワン IFR 12/06 13/05 国際Ⅰ ','O'
    SELECT EngagementId_txt FROM #test
    WHERE
    EngagementId_txt = '15614483'
    AND
    ltrim(rtrim(CAST (EngagementName_txt AS NVARCHAR (90)))) =
    ltrim(rtrim(CAST ('メタルワン IFR 12/06 13/05 国際Ⅰ' AS NVARCHAR (90))))
    EngagementId_txt
    15614483
    (1 row(s) affected)
    Sanil Mhatre | Database Developer | MCTS | If you find my reply useful in any way, please vote it as helpful. If it has helped answer your question, please mark it as Answer. http://sqlwithsanil.com

  • Convert from std::string to CString in UNICODE builds

    Actually I tried all ways but they didn't help me. 
    Is there any working code to convert from std::string to
    CString in UNICODE builds?
    Thanks.
    Mirjalal

    Using non-Unicode string literals in VC++ is asking for trouble, the exact result depends on the codepage of the system used to compile the program and the codepage of the system used to run the program. For example on my system I get 2 question
    marks instead of one, one for ş and one for ə.
    I also get to compilation warnings:
    warning C4566: character represented by universal-character-name '\u015F' cannot be represented in the current code page (1252)
    warning C4566: character represented by universal-character-name '\u0259' cannot be represented in the current code page (1252)
    The easiest solution is to use Unicode string literals and std::wstring:
    wstring z = L"nüşabə";
    CString cs(z.c_str());
    nameData.SetWindowTextW(cs);
    If you can't do that things will get complicated. If you need help with this please give more information. Knowing the compiler version and the system codepage would be useful.

Maybe you are looking for

  • How can i add apps to my ipod touch 2 with ios 4.2.1

    how can i add apps to my ipod touch 2 with ios 4.2.1

  • Nokia N97 Mini Wi-Fi Keeps Seaching

    Hi, I am experienceing a very unpleasant problem with my N97 mini and so far I haven't seen any recommendations or recovery tips on this one. When I go into the WLAN settings and start searching for a connection (for example my home Wi-Fi), the phone

  • Request in Pivot Table - HELP

    Hi, I have created a request in Pivot Table. Rows section Include Product Domain column and Columns Section Includes Month ; measures section contains columns gross, profit, loss and YTD %. I want YTD% column to appear after Dec month and it is shoul

  • Idoc extension for eewb custom fields for BUS20001

    Hello. I have an almost exact question as , but I still need to ask what I'm supposed to do. We've done enhancements in EEW and I can see some append structures in CRMXIF_BUSTRANS (for example). The problem is that when I generate outbound idoc the s

  • URGENT!! Strings - Please help

    Hi I am urgently requiring help here. Any help would be greatly appreciated. I have a string: <clip clipID="{F46F8F95-DB46-4ECE-A44E-5906C7CC60EE}" originalFileName="009033d.rm" I need to find the string inside that starts with the first { and ends w