Character int referencing in java

This'll take some of you all of 2 seconds....
I was wondering if you can reference character ints the same way as u can with the C language ... eg. '0' (with single apostrophe's) = 48, 'd' = 100 etc..
I've been using C and am a newbie to Java
Can u help?

.. actually "int i = c" is enough in the above case but anyhow, that's the way it goes...

Similar Messages

  • Weird cntrl character showing up within Java code

    Hi: I have a varchar field in a oracle table which has some special characters towards the end. if I do a select on that record field from sqlplus command, it doesn't show me the special character. But the java program I have sees it as ^Z. But if I try to use the strip function it doesn't see the special character as well. Any suggestions on how I can remove the special character from the string.
    Thanks
    Ravi

    Can you convert the column value to hex and inspect it that way? Most special characters won't show up. Once you figure out what the actual value is you should be able to strip it out easily enough.
    Cheers, Max

  • Where to find example code referenced in Java WebServices Tutorial, v1.5_01

    Java WebServices Tutorial, v1.5_01 refenced a lot of code examples, which are supposed to be in <JWSDP_HOME>/docs/tutorial/examples.
    I have downloaded and installed "Java Web Services Developer Pack v1.5" and "Java WebServices Tutorial, v1.5_01" from http://java.sun.com/webservices/downloads/webservicespack.html
    But none of these downloads includes the code examples.
    Thanks for any hitns.

    Thanks.
    But you were talking about a different set of examples referenced in a different document. You can get these examples when you install downloaded file:jwsdp-1_5-windows-i586.exe
    The code examples I am looking for are referenced in:
    "Java WebServices Tutorial, v1.5_01"
    and this document can be downloaded at:
    http://java.sun.com/webservices/downloads/webservicespack.html

  • Need help in how to print new line character in unix using java

    Hi All,
    I use the printstream class to print some line in a text using java.
    here is the code:
       FileOutputStream out; // declare a file output object
            PrintStream p; // declare a print stream object
                    p.print("\t");
                    p.print(date);
                    p.print("\t\t");
                    p.print(RecCount);
                    p.println("\n");when i use this and output of this character in windows is
    date RecCount
    22-07-2007 23456
    when i use the same code in unix it shows the following output:
    date RecCount[]22-07-2007
    it wont accept the new line character could any one give me an idea to solve this problem.

    PrintStream has a println() method. Use that. Or System.getProperty("line.separator").
    Because a newline char doesn't necessarily specify a line break. It's system-dependent.

  • How to read a C structure with string and int with a java server using sock

    I ve made a C agent returning some information and I want to get them with my java server. I ve settled communication with connected socket but I m only able to read strings.
    I want to know how can I read strings and int with the same stream because they are sent at the same time:
    C pgm sent structure :
    char* chaine1;
    char* chaine2;
    int nb1;
    int nb2;
    I want to read this with my java stream I know readline methode to get the first two string but after two readline how should I do to get the two int values ?
    Any idea would be a good help...
    thanks.
    Nicolas (France)

    Does the server sent the ints in little endian or big endian format?
    The class java.io.DataInputStream (with the method readInt()) can be used to read ints as binary from the stream - see if you can use it.

  • What is the escape character for DOT in java regex?

    How to specify a dot character in a java regex?
    . itself represents any character
    \. is an illegal escape character

    The regex engine needs to see \. but if you're putting it into a String literal in a .java file, you need to make it \\., as Rene said. This is because the compiler also uses \ as an escape character, so it will take the first \ as escaping the second one, and remove it, and the string that gets passed onto the regex will be \.

  • Referencing Shared Java EE Libs in Weblogic from WAR inside EAR

    We have a number of applications that need to reference to both Oracle and our own Shared Java EE Libraries on WebLogic. They are structured as folows:
    Our own shared library, "framework", is packaged as a JAR inside an EAR, along with all non-Oracle, third-party libraries (JAR:s) and deployed as a shared library in WebLogic. This is it's manifest:
    Manifest-Version: 1.0
    Created-By: Apache Maven 3.0.4
    Built-By: lajokon
    Build-Jdk: 1.7.0_07
    Implementation-Vendor: <organization>
    Implementation-Title: Framework Lib
    Implementation-Version: 15.0.2
    Implementation-Vendor-Id: org
    Specification-Vendor: <organization>
    Specification-Title: Framework Lib
    Specification-Version: 15.0.2
    Extension-Name: framework-lib
    All JAR:s are in APP-INF/lib
    The applications are each packaged in a WAR inside its own EAR. The WAR weblogic.xml:
    <wls:weblogic-web-app>
    <wls:weblogic-version>10.3.6</wls:weblogic-version>
    <wls:context-root>app-name</wls:context-root>
    <wls:library-ref>
    <wls:library-name>adf.oracle.domain.webapp</wls:library-name>
    <wls:specification-version>1.0</wls:specification-version>
    <wls:exact-match>false</wls:exact-match>
    </wls:library-ref>
    <wls:library-ref>
    <wls:library-name>jsf</wls:library-name>
    <wls:specification-version>2.0</wls:specification-version>
    <wls:exact-match>false</wls:exact-match>
    </wls:library-ref>
    </wls:weblogic-web-app>
    The EAR application.xml:
    <application>
    <display-name>app-name</display-name>
    <module>
    <web>
    <web-uri>app-name.war</web-uri>
    <context-root>/app-name</context-root>
    </web>
    </module>
    </application>
    The EAR weblogic-application.xml:
    <weblogic-application>
    <library-ref>
    <library-name>adf.oracle.domain</library-name>
    <specification-version>1.0</specification-version>
    <exact-match>false</exact-match>
    </library-ref>
    <library-ref>
    <library-name>coherence</library-name>
    <specification-version>3.7</specification-version>
    <exact-match>false</exact-match>
    </library-ref>
    <library-ref>
    <library-name>framework-lib</library-name>
    <specification-version>15.0</specification-version>
    <exact-match>false</exact-match>
    </library-ref>
    </weblogic-application>
    All libraries are deployed by default or deploy correctly in WL. As does the application EAR.
    But, when I access the application i get runtime errors saying it can't load resources located in the WAR:s WEB-INF/classes dir!?
    However, I can see, from log output, that it loads resources from the Framework EAR. Why does WL not seem to care about the contents of my WAR?

    If I use the Admin Server Console to view the shared library, I can see ecif-ear(1.0,1.0) in the Deployments list. Its State is shown as "Active", Type is "Library", Deployment Order is 100.
    I deployed the shared library using the Admin Server Console but deployed the referencing application using WorkShop for WebLogic Platform by Run As -> Run on Server. The Eclipse error log shows the following Exception Stack Trace:
    com.bea.workshop.wls.core.j2eelib.UnresolvableReferenceException: ecif-ear|1.0|1.0|true
         at com.bea.workshop.wls.core.j2eelib.LibraryModuleRegistry.resolve(LibraryModuleRegistry.java:106)
         at com.bea.workshop.wls.core.j2eelib.LibraryModulesSvc.resolve(LibraryModulesSvc.java:884)
         at com.bea.workshop.wls.core.server.internal.J2EEDeploymentHelper.deployLibraryModules(J2EEDeploymentHelper.java:409)
         at com.bea.workshop.wls.core.server.internal.J2EEDeploymentHelper.deployAllLibraryModules(J2EEDeploymentHelper.java:392)
         at com.bea.workshop.wls.core.server.internal.J2EEDeploymentHelper.deploy(J2EEDeploymentHelper.java:198)
         at com.bea.workshop.wls.core.server.internal.WeblogicServerBehaviour.publishModules(WeblogicServerBehaviour.java:893)
         at com.bea.workshop.wls.core.server.internal.WeblogicServerBehaviour.publishOnce(WeblogicServerBehaviour.java:459)
         at com.bea.workshop.wls.core.server.internal.WeblogicServerBehaviour.publish(WeblogicServerBehaviour.java:334)
         at org.eclipse.wst.server.core.internal.Server.doPublish(Server.java:862)
         at org.eclipse.wst.server.core.internal.Server.publish(Server.java:850)
         at org.eclipse.wst.server.core.internal.PublishServerJob.run(PublishServerJob.java:142)
         at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)

  • Inserting broken pipe character in DB from Java creating problem

    Hello experts,
    We want to insert a broker pipe character in oracle 10g from java.
    But it get changed to pipe character.
    We are having japanese client for which we want to maintain this kind of character.
    If someone know the solution, please update.

    Hi,
    I understand your explanation.
    It is not possible to put actual code, that's complex and coupled with other things.
    I like to share the scenario where it failing,
    1. Broken Pipe character(double byte (\u00fa\u0055)) is put along with other japanese long text in a *.txt file.
    2. A java file reads the above *.txt file and inserts the file text in a table column in oracle.
    The .txt file is saved in Shift_JIS encoding.
    In java file, the same *.txt file is read using 'CP943C' charset and written into database.
    So as per your suggestion I have to compare literal first and than if I found broken bar in file, I need to change it with specified unicode.
    Is that so?
    --Saurabh.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Name of an int ( e.g. java.sql.Types )

    I have the sql.Types code as an int number and want to display the name. Is there a straightforward method or do I have to search it in a loop like here ?
    String getName(int i) {
    for (Field f: java.sql.Types.class.getFields()) {
         if (f.getType().equals(int.class)) {
              if (f.getInt(f.getType()) == i) {
              System.out.println( i + " = "+f.getName() );
              // e.g.               8 = DOUBLE
              return f.getName();
    }This question is not specific to java.sql.Types I guess (that's why I post here).
    A dedicated hint for sql is appreciated as well, however ;)

    Seems the loop is required and it works (in no time, there aren't too many Fields)
         if (f.getInt(f.getType()) == i) {Having a closer look, I do not understand the inner f.getType() , however.
    f.getInt() requires an object, but anything, including null, works ?!
    Any hint, or link where to learn about java.lang.reflect.Field, please ?

  • Generating TOC with Character Styles Referenced

    I have a paragraph style applied so several paragraphs in a document.  This paragraph style has a nested style for the first few words of the paragraph which also have a specific character style assigned to them.  The thing is that I need to be able to reference or list these first few in my TOC.  I'm aware that the automatically generated TOC doesn't have the ability to refrence character styles, but I'm hoping that someone else knows of a way around this.  Does anyone know how to work around that or include, somehow, character styles in the TOC list?  The main reason I'm needing to do this is because the automaticly generated TOC (Layout > Table of Content) is built in such a way that it can be recognized in the settings when exporting to epub.

    It was a good idea and almost worked.  I created an extra textbox with the text I wanted included in that text box with a specific paragraph style applied to it that has non-printing text.  Once I included the paragraph style in the Automatically generated TOC it worked in generating the text in the TOC line up, but when I exported the file to an EPUB there was no way to tell it not to include the text that where non-printing.  Therefore the words/sentences that were not visible in indesign or on print and anchored to the original text were doubled in the final epub version.

  • Non supported character set: oracle-character-set-171'  in java XSU

    I cannt update object type CHAR data in table cause Non
    supported character set: oracle-character-set-171'
    NLS lang UTF-8
    database language WIN-1251

    I think it is a bug at JDBC-OCI Driver.
    Now I am useing setPlsqlIndexTable to transfer
    a var to PLSQL procedure, and want to
    retrieve it from out parameter.
    When I transfer English characters, it can
    work correctly, but if I transfer Japnese or
    Chinese characters, the disorderly characters
    were returned. I have not resolved this problem
    yet. Who can tell me how to resolve it.

  • How to Export the chinese character in excel using java

    Hi,
    Our application using in English, German, Franch and chinese.
    String chineseCharacter=""; // chineseCharacter like &#38263;&#38271;&#29248;&#24202;&#26481;&#19996;&#24447;&#20315;. This chinese data coming from oracle database..
    My code
    BufferedWriter printer = new BufferedWriter(new OutputStreamWriter(responses.getOutputStream(),"utf-8"));
    responses.setContentType("application/download");
    responses.setHeader("Cache-Control", "cache");
    responses.setHeader("pragma", "cache");
    ExcelCSVPrinter outcr = new ExcelCSVPrinter(printer);
    String displayname="ChineseReport.csv";
    responses.setHeader("Content-Disposition","inline; filename=\"" + displayname + "\"");
    outcr.write("Report Header Name");
    outcr.writeln();
    outcr.write(chineseCharacter);
    outcr.writeln();
    After export the data to excel show the result for 長长牀床東东彿佛. But not show the original result &#38263;&#38271;&#29248;&#24202;&#26481;&#19996;&#24447;&#20315;
    I use the following stmt
    responses.setContentType("text/html charset=UTF-8");
    Its shows the correct result for chinese character.
    I use the below statement
    responses.setContentType("application/download; charset=UTF-8");
    or
    responses.setContentType("application/vnd.ms-excelset;charset=UTF-8");      
    or     
    responses.setContentType("application/vnd.ms-excel;charset=UTF-8");
    The out put show the in the excel sheet ???????? or some other jung characters.
    What can i do here?. After export,I want to show the original chinese character in the excel sheet using the ExcelCSVPrinter.
    Thanks & Regards
    Thendral
    Edited by: palanithendral on Dec 24, 2009 5:14 AM
    Edited by: palanithendral on Dec 29, 2009 11:41 AM

    palanithendral wrote:
    Hi,
    Our application using in English, German, Franch and chinese.You have several different idioms in your application and have not accurately identified where the actual problem is. You have all of the following
    -database
    -http
    -excel
    -excel in http
    -display on the target computer
    The first step with these sorts of problem is to identify where the problem actually occurs.
    String chineseCharacter=""; // chineseCharacter like &#38263;&#38271;&#29248;&#24202;&#26481;&#19996;&#24447;&#20315;. This chinese data coming from oracle database..A good theory. Now explain how you proved that that is what is coming from the database.
    After export the data to excel show the result for 長长牀床東东彿佛.As another example. Presumably you are referring to what the browser on the target computer displays. Your theory is that that computer and that browser (together) will display the correct information if they had the correct data. How did you prove that?

  • GetScale(int) method of java.sql.ResultSetMetaData

    On weblogic 8.1 instance I am using oracle JDBC TYPE 4 Thin driver.
    The jar file for the driver is ojdbc14.jar.
    Our database is 9.2.0.
    code excerpt:
    //rs is the resultset
    if (rs != null)
    ResultSetMetaData RSMD = rs.getMetaData();
    int i = RSMD.getColumnCount();
    int test=0;
    String cName="";
    for(int j = 1; j <= i; j++)
    test = RSMD.getScale(j);
    cName = RSMD.getColumnName(j);
    System.out.println("The scale of column name : "+cName+ " is " +test);
    The output is:
    The scale of column name : PERSON_ID is -127
    The scale of column name : FIRST_NAME is 0
    The scale of column name : LAST_NAME is 0
    The data type of column PERSON_ID is NUMBER. Why is it so? getScale(int) should return zero for a column whose data type is NUMBER.
    Help me. Is it driver specific probelm?

    Hi,
    I have a similar problem. I want to find out the column names when i fire raw-sql. I use SQLCall to do this.
    Then I get a Vector<DatabaseRow>.
    Vector vDR = session.executeQuery( new SQLCall( "select * from table_name" ) )
    Now Is there a way to find out the column names dynamically. In the javadocs i see that objDatabaseRow.keys() returns an Enum<DatabaseField>... but i cant see javadocs on how to use DatabaseField.
    So is there any other way ?
    Thanks,
    Krishna

  • Question: Referencing a Java Object

    I think I'm suffering from an attack of the 'stupids'. I can't figure out how to do this and I'm sure it's something simple. Any help would be appreciated. I'm simplifying this and I hope I don't mess it up as a result.
    I have 4 classes, each written by a different programmer (so no one knows what another person called something). These classes are: MyFrame (extends JFrame), MyData (a data storage object that contains the method 'setData1 (int x)'), MyPanel1 (extends JPanel), and MyPanel2 (extends JPanel).
    When the program is run, MyFrame makes 2 objects: Data1 (from MyData) and Panel1 (from MyPanel). In its constructor, MyPanel makes object Panel2 (from MyPanel2).
    Now... the question. At some point, Panel2 wants to write something to Data1. What is the proper syntax and/or mechanisms to do this? Remember, in this example, the MyData object is named Data1, but in 'reality' the object can be called anything the programmer wants
    I hope this makes sense.
    Thanks
    MistWing SilverTail

    You'll need to pass references around (usually in the constructors), but since you (I'm assuming) can't change/rewrite the classes.... I don't think it could be done.
    Even if MyData was declared public, Panel2 can't see MyFrame.
    Good luck,
    Radish21

  • Character, int value and radix

    I'm iterating through strings testing for ASCII characters > 127 (e.g. in MS Word, typing in "..." creates a single character of 3 dots (ASCII 133)).
    When I use Character.digit(char, radix) and a character > 127 is found, -1 is returned. But I need to find out what the ASCII value is when it's > 127. I'm not clear on how to use the radix value and my searches on the web have only made it murkier. Anyone who can help me clear this up would be greatly appreciated.
    Thank you
    Tom Berry

    I want to find the actual ASCII value to remap it to a usable ASCII character(s) < 127. For example, type 3 periods "..." in MSWord. It will automatically change to ASCII 133. When a user cuts and pastes text from MSWord to one of my web apps, and the data is saved to SQL Server, any of these 'MS' characters > 127 becomes a "?" when it is retrieved and displayed on a HTML page. I'm trying to intercept this text and correct the characters.
    I'm currently doing the following:
    a. Character.getNumericValue(char) == -1,
    b. Create a new Character object of the char,
    c. The method .hashCode() gives me the Character's ASCII value,
    d. If > 127 (CR, LF, SPACE, etc are also caught in this), I pass the ASCII value to a HashMap which returns the correct character.
    This seems to inefficient. I was hoping to be able to get the ASCII value at step a. and so not be creating new Character objects each time the NumericValue == -1.

Maybe you are looking for

  • Problem with Substring

    Here's my code.. String Varble = rs0.getString("adddate").substring(0,10); out.println("<td>" + stmt + "</td>"); I've also tried this (which is the same thing just more code) Now it DOES work if I make tinydate text. String tinydate = rs0.getString("

  • Placing .png in illustrator

    Hi folks! I don't know what I am doing different.... I have created an icon in illustrator and saved for web, but when I try to place it in illustrator it has a white background. When saving for web I left the transparency box ticked... Does anyone h

  • userlib files not being found in built applicatio​n

    Version: 2012 SP1 f5 Key Words: Build Application, <userlib>, DAQmx I have a project with a Main.vi and and a Sub.vi, both of which make multiple calls to DAQmx vi's in libraries (*.llb). The project is located in ...LabView 2012\user.lib\this\this.l

  • Can not present customized item attribute.

    I created new customized item attribute and new item type. On the items area, I chose to present the new customized item attribute. After submit a new item, I can see the new customized attribute under edit mode, however, I can not see it under view

  • Is CS4 compatible to 3.1 files?

    Need to know if CS4 can read/use files created in 3.1 version. Thanks in advance for any help.