Java Data Types?

Hi,
shall we say
The data types in Java 1.5 can be divided into 4 categories. They are:
i.     Primitive Data Types
ii.     Abstract Data Types
iii.     Arrays
iv.     Enumerated Data Types
...............?

Raijinsetsu wrote:
I have to agree with jverd...
Abstract is not a data type. Abstract declares a specific type of class which cannot be instantiated. Enumerations are just specialized objects. Arrays are also specialized objects.One could choose to consider arrays, enums, and abstract classes as separate categories.
>
If you wanted, the full list would be:
Object (reference is another term you could apply to objects)
int
long
short
byte
charEven if you include the primitives you forgot, this list is just as arbitrary as the original one, and does not correspond to the JLS.
In particular, Object is not a type. There are primitives, references, and the null type.
Edited by: jverd on May 6, 2009 7:56 AM

Similar Messages

  • External SOAP client Accessing Webservice using built in Java Data type

    We have built a webservice and deployed it on WLS. We accessed this from a swing
    client it works fine.The webservice methods uses non-built in JAVA data types
    as parameters.These are Value Objects and the JAVA Serializer and Deserializer
    classes are generated using Ant task itself.The client coding uses Value objects
    given by the Client_jar (generated using <Clientgen> ant task) to pass to the
    webservice. We dont want to go by this way.Is there anyway were in we can pass
    parameters to the method which expects non-built in java datatypes?
    Why i am asking this is, i want to know how an external client (.Net client )
    will be able to exceute my webservice (i.e., passing the required Object which
    the method is expecting)?

    Hi Anish,
    Well first off, your web service doesn't send or receive "objects". It only sends
    and recieves XML, which is in turn converted to/from Java objects at invocation
    time. Second, a .NET (or Perl, or Python, or C++) client will be able to call
    your web service, because the wsdl.exe tool (for .NET) will generate "programming
    language specific" objects from the <types><schema> elements, in the WSDL of your
    web service :-) The wsdl.exe tool will create C# objects from the WSDL, that will
    convert XML to/from C# when your web service is called. That's the beauty of XML
    schema - it's a "universal typing system", so it's not tied to a particular programming
    language. The only issue is whether or not the web services platform vendor's
    XML Schema/WSDL processor, can successfully process the WSDL. Some vendors have
    more complete implementations of the WSDL and XML Schema specs than others, so
    expect varying success here. The one in WLS 7.0 is pretty good, so you shouldn't
    have too many problems consuming WSDL generated by .NET tools (or any other tool
    for that matter).
    Regards,
    Mike Wooten
    "Anish" <[email protected]> wrote:
    >
    We have built a webservice and deployed it on WLS. We accessed this from
    a swing
    client it works fine.The webservice methods uses non-built in JAVA data
    types
    as parameters.These are Value Objects and the JAVA Serializer and Deserializer
    classes are generated using Ant task itself.The client coding uses Value
    objects
    given by the Client_jar (generated using <Clientgen> ant task) to pass
    to the
    webservice. We dont want to go by this way.Is there anyway were in we
    can pass
    parameters to the method which expects non-built in java datatypes?
    Why i am asking this is, i want to know how an external client (.Net
    client )
    will be able to exceute my webservice (i.e., passing the required Object
    which
    the method is expecting)?

  • Java data types are tightly coupled or loosely coupled ?

    java data types are tightly coupled or loosely coupled ?

    Is this another interview question? If so, the answer you should have given is, "You, sir, have been smoking too much crack."

  • Conversion of Packed Decimal Numbers to Java Data Types

    Hi all,
    I'm working with a mainframe file which contains datas in Packed Decimal Numbers.My requirement is to convert these datas to Java datatypes and also to convert the Java datatypes to Packed Decimal Numbers before storing them in the mainframe.
    Can anyone help me out with any code for converting Java data types to/from other data formats such as: EBCDIC, IBM370 COMP (binary numbers up to 9 digits), and COMP-16 (packed decimal numbers)?
    I would hugely appreciate any response to my query.
    Thanking you all,
    Kaushik.

    Rather than go that route, I'd instead look into providing a "service" on your mainframe to:
    1) provide a textual representation of the numbers (from native to text)
    2) read text, converting to native numeric storage
    And use that service to retrieve that information by your Java app (1)Similarly, instead of trying to write natively-formatted numbers from your Java app, I'd write it as text and make that same "service" read the text (2)
    This is the kind of thing XML is for.

  • New user for java (Data type conversion)

    Hi all, I'm the newer from JAVA, just start to learn it few weeks before, there have some problem about me.
    I want to konw how to change the data type ??For example, if I have a string call year and store the char "1", how can I change that field to int type ?
    Thanks very much

    You should have a link to, or download, the API docs. You can see them on line at:
    http://java.sun.com/j2se/1.3/docs/api/index.html
    Look up the class Integer. It has a static method, parseInt() which takes a String argument and returns an int.. Since it is static, you can do the following:
    int value = Integer.parseInt(your_string);
    Then, to make it robust, you can put try/catch around it and catch NumberFormatException if you need to do error checking.

  • Using java date type

    Hi,
    Is possible to use one data type defined in java in one forms.? How do yo define this type in forms. We need insert data in one vector java(defined in java).
    Thank all

    for example:
    javax.jcr.Session session = resourceResolver.adaptTo(Session.class);
    String parentPath = "/content/blah"; // or whatever your parent path is
    String nodetype = "nt:unstructured"; // or whatever other node type you require
    Calendar calendar = Calendar.getInstance(); // or whatever date
    Node node = session.getNode(parentPath).addNode("nodename", nodetype);
    node.setProperty("myproperty", calendar);
    session.save();

  • Java data type - byte

    Hi;
    I've a question here, hopefully some one can help me to clear my doubt.
    private byte[] buf = new byte[1024];
    as the declaration done above, does that mean the buf can hold until 1024 bytes data? as i know, byte data type only able to hold +2 power of 8 till -2 power of 7.
    YY.

    private byte[] buf = new byte[1024];
    as the declaration done above, does that mean the buf can hold until
    1024 bytes data? Yep, you've just defined an array of 1024 bytes, all neatly lined up next
    to eachother, the first byte can be retrieved or altered by indexing it like
    this: 'buf[0]', the next one as 'buf[1]' and the last one as 'buf[1023]'.
    as i know, byte data type only able to hold +2 power of 8 till -2 power of 7.Erm, almost; a byte can store any integral number in the range -128 to 127
    inclusive, i.e. -2**7 to 2**7-1.
    kind regards,
    Jos

  • WS returns an invalid java data type

    Hello guys, I started using BPM Studio 2 weeks ago, and I am stuck at this point:
    I get these message:
    Error workspace-1381754584564
    Activity '/TramitaciónPedido#Default-1.0/GlobalCreation[RealiarPedido]' task '' could not execute successfully.
    Detail:Method: '', Exception: 'El método 'CIL_beginBeginIn' de la clase 'OracleBPM_Lab2.TramitaciónPedido.Default_1_0.Instance' no se ha podido ejecutar correctamente.'
    Caused by: The method 'CIL_beginBeginIn' from class 'OracleBPM_Lab2.TramitaciónPedido.Default_1_0.Instance' could not be successfully executed.
    Caused by: Attempt to set empty javaType to return(hassetter hasgetter public,0) :: fuego.type.FuegoClass$LazyRef@190ce52. It must be null or a valid java type.
    fuego.papi.exception.ActivityFailedException: La tarea '' de la actividad '/TramitaciónPedido#Default-1.0/GlobalCreation[RealiarPedido]' no se ha podido ejecutar correctamente.
    Detalle:Método: '', Excepción: 'El método 'CIL_beginBeginIn' de la clase 'OracleBPM_Lab2.TramitaciónPedido.Default_1_0.Instance' no se ha podido ejecutar correctamente.'
    This is the code that calls the ws:
    // Inicilaiza parámetros fijos del expediente
    expediente.idInstancia = this.id.local
    expediente.intentosContactoCandidato = parametrosExpediente.maxIntentosContacto
    expediente.operador = null
    expediente.documentalista = null
    expediente.tarificador = null
    expediente.unidadOrganizativa = UnidadesOrganizativas.spain
    logMessage "Guzman: expediente.idInstancia "+expediente.idInstancia
    logMessage "Guzman: expediente.intentosContactoCandidato: " +expediente.intentosContactoCandidato
    logMessage "Guzman: expediente.unidadOrganizativa: "+expediente.unidadOrganizativa
    respuestaCRM as SCOR.WEBSERVICES.CRM.FrontalWsdl.RespuestaCRM
    filtro as SCOR.WEBSERVICES.CRM.FrontalWsdl.Filtro
    filtro.clave = ClaveFiltro.EXPEDIENTE
    filtro.valor = "00020353"
    usuarioCRM as SCOR.WEBSERVICES.CRM.FrontalWsdl.Usuario = SCOR.WEBSERVICES.CRM.Usuario()
    logMessage "Guzman: filtro.clave= "+filtro.clave
    logMessage "Guzman: filtro.valor= "+filtro.valor
        usuarioCRM.unidadOrganizativa = "ES"
        usuarioCRM.usuario = "usuarioBPM"
        usuarioCRM.clave = "P@ssword"
        usuarioCRM.dominio = "adminesp"
    consultaExpediente FrontalService
        using arg0 = usuarioCRM,
              arg1 = filtro
        returning respuestaCRM = @return
    logMessage "Guzman: usuarioCRM.unidadOrganizativa: "+usuarioCRM.unidadOrganizativa
    logMessage "Guzman: usuarioCRM.usuario: " +usuarioCRM.usuario
    logMessage "Guzman: usuarioCRM.calve: "+usuarioCRM.clave
    logMessage "Guzman: usuarioCRM.dominio: "+usuarioCRM.dominio
    I know wich is the problem but I don´t know how to solve it, I will apreciate any help, thanks in advance.

    SQL Developer may not recognise the date formats in your EXCEL so you need to tell it what it is. Check and note the value of the date column in the EXCEL file, then use the date format in the Map Source Data to Existing Table section in SQL Developer during the Import Data dialog.
    For example. if the data in EXCEL is 22-JUN-09. Select the column in the above mentioned section and enter DD-MON-RR (or DD-MON-YY) in the Date Format before klicking Next to Verify. This should work perfectly.

  • How do I return a java.sql.Timestamp data type in a Web service?

    I'm new to workshop and java. I'm creating a mini application to simulate a real work Web Service (development environment is on an intranet). I was able to completely simulate the Web Services minus all date values.
    I'm using a standard weblogic workshop database controls that are feeding the various WebServices and their methods (Web services was generated from DB control). I get a java type not support error when I attempt to return a java.sql.Timestamp. I temporarily got around the problem by omitting all dates from the sql.
    However, we are at the point where we need the complete record.
    My two questions
    1) What java data type do I convert the java.sql.Timestamp to
    2) Where and how do I do it in workshop.
    Thanks in advance
    Derrick
    Source view from workshop looks something like this.
    public interface MyData extends DatabaseControl, com.bea.control.ControlExtension
    static public class dbOverallRec
    public String key;
    public String field1;
    public int field2;
    public java.sql.Timestamp create_date
    public dbOverallRec () {};
    *@jc:sq; rowset-name="OverallRowSet" statement::
    *select key, field1, field2 ,create_date from overall where key={KEY}::
    dbOverallRec getOverallByKey(String Key);
    * I had to omit the create_date to get it to work

    You should try changing java.sql.Timestamp to java.util.Calendar.
    java.util.Calendar maps to the dateTime type in XML Schema, and TIMESTAMP as a JDBC type.
    Regards,
    Mike Wooten

  • Bea and nvarchar2 data type in oracle

    Does weblogic server supports nvarchar2 data type in Oracle?..
    I use CMP with java data type String mapped to nvarchar2 data type to oracle.when
    i try to create a bean it throws "java.sql.SQLException: ORA-12704: character set
    mismatch". Is there any configuration in the server to set the character set?..
    can anyone help me on this?...

    Does weblogic server supports nvarchar2 data type in Oracle?..
    I use CMP with java data type String mapped to nvarchar2 data type to oracle.when
    i try to create a bean it throws "java.sql.SQLException: ORA-12704: character set
    mismatch". Is there any configuration in the server to set the character set?..
    can anyone help me on this?...

  • Problems with date types

    Hi guys,
    i have a question regarding oracle and java dates. In my database i have a column defined as oracle Date type.
    In my java application i need to compare these dates with the date took from the system.
    In order to do this i use the SQL function to_char which converts the oracle data type to the type string.After this, i use the java class DateFormat to convert the strings to the java date type.When i have java dates i can do operations on them easly. My question is how i can realize the opposite process.For example, when i have updated a date with java, what i can do is converting it to a string, but then how the date could be converted in Oracle date type? (The attribute in my entity object is defined as oracle date )
    Thank you

    ADF use oracle.jbo.domain.Date, so you need to convert from java.util.Date and vice versa.
    from oracle Date to java Date:
    new java.util.Date(((oracle.jbo.domain.Date) oDate).dateValue().getTime());
    from Java Date to oracle Date
    new oracle.jbo.domain.Date(new Timestamp(date.getTime()));
    If you are using JClient, this is a big problem. We have simmilar challenges in the lack of DatePicker until we implemented it ourselves:
    http://www.inpowersoft.com/inpowerforms/demo/viewlets/datePicker.htm
    -Don

  • WS Proxy and Data Types

    Hello All,
    JDeveloper 11.1.1.5
    In my project we expect to generate many web service proxies for various web services. Some of these services use "common" XML types which share the same definition (including namespace). We want to have only one set of Java objects that correspond to the shared XML types. I tried a simple idea - specify the same package for data types when generating the proxies. However, JDeveloper overwrites the ObjectFactory every time and removes methods from the previous proxy generation (especially the XML types that are not used by the new web service).
    What is the best practice to manage the Java data-types creation in this case?
    Thanks in advance.

    Best to generate proxies without specifying package names for generated types.

  • How to insert data type information to oracle database

    Hi, there,
    I want to insert date information to oracle database in a jsp page using JSTL. but always got wrong message:
    javax.servlet.jsp.JspException:
    INSERT INTO DATE_TEST
    (date_default,date_short,date_medium)
    values(?,?,?)
    : Invalid column type
    I don't know how to convert java date type to oracle date type or vice versa. the following is the source code(all the fields of DATE_DEFAULT,DATE_SHORT,DATE_MEDIUM are oracle date type. and even I want to insert d instead d1, I got the same wrong message)
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="java.util.*" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
    <%
    Calendar now;
    Calendar rightNow = Calendar.getInstance();
    %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>
    Hello World
    </title>
    </head>
    <body>
    <h2>
    The current time is:
    </h2>
    <p>
    <%= new java.util.Date() %></p>
    <%
    java.util.Date d=new java.util.Date();
    java.sql.Date d1=new java.sql.Date(d.getYear(),d.getMonth(),d.getDate());
    out.print(d1.toString());
    %>
    <sql:update>
    INSERT INTO DATE_TEST
    (DATE_DEFAULT,DATE_SHORT,DATE_MEDIUM)
    VALUES(?,?,?)
    <sql:dateParam value="${d}" type="date" />
    <sql:dateParam value="${d}" type="date" />
    <sql:dateParam value="${d}" type="date" />
    </sql:update>
    </body>
    </html>
    thank you very much for the great help!!

    I don't have time to read thru all your code, but I hope this information will help you.
    It depends on how the Oracle database was set up. Usually, the date format is something like this: '27-MAY-2003 22:10:00'. A quick check will be to run this SQL script in SQLPlus:
    select sysdate from dual;
    You have to convert the date from textbox or whatever to this exact Oracle format. Otherwise, Oracle will not accept it. It is very picky on that. I found the best way is to do the conversion inside the SQL statement. It makes life so much easier.
    Hope this helps.

  • How to get the values from struct data type using java code..?

    Hi ,
    I am newer to java.
    we are using oracle database.
    How to get the data from struct data type using java code.
    Thanks in Advance.
    Regards,
    kumar

    Hi Rajeev,
    To retrieve a FilterContainer you will need to traverse the report structure:
    ReportStructure boReportStructure = boDocumentInstance.getStructure();
    ReportContainer boReportContainer = (ReportContainer) boReportStructure.getReportElement(0);
    FilterContainer boFilterContainer = null;
    if (boReportContainer.hasFilter()) {
         boFilterContainer = boReportContainer.getFilter();
    } else {
         boFilterContainer = boReportContainer.createFilter(LogicalOperator.AND);
    Calling boDocumentInstance.getStructure() will retrieve the entire structure for the document.
    Calling boReportStructure.getReportElement(0) will retrieve the structure for the first report of the document.
    Hope this helps.
    Regards,
    Dan

  • PLEASE HELP!!!  Problem with Java and SQLServer Text data type

    Hi there,
    I have a java app. that reads from an MS SQLServer database. Originally, all long text fields were declared as NVARCHAR(200). The program worked fine.
    Someone then advised that I change all long text fields to the TEXT data type. The program now crashes out with the following Exception:
    "java.sql.SQLException: [JRun][SQLServer JDBC Driver]This ResultSet can not re-read row data for column 25."
    Basically, I have a method that retrieves a resulset and iterates through it. The resultset is passed to another method during each iteration. In the example below, the 'specialNote' field used to be NVARCHAR(200). The code worked fine. Then when it was changed to TEXT, the program no longer works with the above Exception thrown.
    Anyone know any special way SQLServer TEXT data types need to be handled?
    Thanks for any advice!
    The code looks something like this in functionality:
    <CODE>
    public void method1 (Connection conn)
    Resultset rs = conn.createStatement().executeQuery("SELECT * FROM ProductBB");
    while (rs.next())
    method2(rs);
    public void method2 (ResultSet rs)
    String str = rs.getString("specialNote");
    </CODE>

    Hi JWoods,
    Thanks for the suggestion. I originally had the code do what you suggested, ie, get the resultset then retrieve the data all within the same method. The data is then used to set properties in an object.
    When I had to create another method that also retrieved a resultset but using a different primary key, then also use the returned data to set the properties in the same type of object, I didn't want to repeat the setter code. That's why I decided to pass the resultsets to the same method that did the property setting.
    Unfortunately, it stopped working with the data type change.
    Any other thoughts?

Maybe you are looking for

  • Opening a PDF Portfolio in a Blackberry

    We're having an issue with opening PDF Portfolio files created with Adobe Acrobat Pro 9. The message we get when opening the PDF file is: "For the Best experience, open this PDF portfolio in Acrobat 9 or Adobe Reader 9, or later.' Your help is apprec

  • Odd Spacing in IE 6 and 7

    I always seem to have this problem. My new site: www.simonephysicalmedicine.com has odd spacing problems in Internet Explorer 6 and 7. I've validated my pages to no avail. The site is online. Can someone please help me. If possible can you explain yo

  • Will OS X allow me to upload PDF files to iCloud?

    We are using a Mac, laptop and iPad.  We uploaded to Mountain Lion recently on the laptop and Mac.  We hoped to use iCloud via the iPad when we travel which is often to access documents on the laptop and Mac.  However, when we attempted to upload doc

  • What is the WLS 7.0 embedded ldap admin account and password?

    I am using (javax.naming.directory.DirContext.modifyAttributes) to change password to our development Weblogic 7.0 embedded LDAP. I login as the system administrator (a user in the administrators group), but always gets the javax.naming.NoPermissionE

  • Path vs Mask

    Hey all... this may just be symantecs or terminology, but why does anyone use masks?  Doesnt creating a path layer with the pen tool away from the actual object layer allow you to do everything and anything with that path area?  I.e., if you CNTRL+Cl