Java Type mapping of NUMBER columns

I'm using JDBC Oracle driver 10.2.0.4, with java 1.5 and Oracle 10.2.0.4.
Reading a field of NUMBER(6) JDBC driver map it to java.lang.Integer, if I extend this column to NUMBER(9) Jdbc map it to java.lang.Long.
When can I find a detailed documentation of Number mapping, i found some documentation for general field mapping but is not exhaustive about NUMBER fields and this behavior is not documented.
Thanks
Carlo

That is all database/driver specific. So you have figure it out using what is in the Oracle java classes. There is no generic jdbc solution. If you are lucky the Oracle docs for the driver might document something useful.
If it was me I would just wrap another proc around it and have that strip the fields out for me and return it as a regular result set.

Similar Messages

  • Attachment to Java type mapping

    I want to create a web services to receive quite big portion of information. So I defined my method as:
    @WebService
    public class Infolet {
        public long run(String name, String enterprise, InputStream instream) throws RunException {
          printStreamContent(instream);
          return 1;
        }wsgen creates wsdl with abstract class InpputStream, so obviousy I can't use a real input stream in my client code matching to this parameter. So what's solution?

    Dave,
    What docs are you looking at? http://docs.solarmetric.com/sql_types.html
    seems to have the complete table.
    -Patrick
    On Sun, 22 Jun 2003 15:44:43 -0600, Dave Ford wrote:
    I am looking at the Kodo manual. And there is table that says:
    "Following is a table of the java class to SQL type that is generated by the
    schematool."
    The problem is, I didn't see any java types.
    Where can I find a table that states the sql types that correspond to java
    types.
    Dave Ford
    Smart Soft - The Developer Training Company
    http://www.smart-soft.com
    Patrick Linskey
    SolarMetric Inc.

  • Toplink JPA and Java type mapping

    Hi there,
    I'm struggling wit mapping an existing database using Toplink Essentials.
    Specifically: I have an INT SQL field which I want to map as boolean/Boolean in my entity class.
    How to do this? Either in standard JPA or with some Toplink extensions?
    Markus

    Hi Markus,
    The JPA spec doesn't cover conversion/transformation but you can do it with TopLink Essentials using a Converter. I have an example pasted below that uses a converter to map between a database VARCHAR value and a pre-Java 5 enum (i.e., a hand coded enum-type class that runs in Java 1.4).
    I use a descriptor customizer to get hold of the Basic mapping (in TopLink a "DirectToFieldMapping") and then plug in a converter.
    --Shaun
    Persistence.xml:
    <property
       name="toplink.descriptor.customizer.TypeWriter"
       value="oracle.toplink.essentials.emf.examples.library.orm.TypeWriterCustomizer"/>The customizer:
    public class TypeWriterCustomizer implements DescriptorCustomizer {
          * Add customizer to translate between Enum and value.
         public void customize(ClassDescriptor descriptor) throws Exception {
              DirectToFieldMapping typeMapping = (DirectToFieldMapping) descriptor.getMappingForAttributeName("type");
              Converter typeWriterEnumConverter = TypeWriterEnumConverter.getInstance();
              typeMapping.setConverter(typeWriterEnumConverter);
    }The actual converter class:
    * TypeWriterEnumConverter is a singleton since it has no state.
    public class TypeWriterEnumConverter implements Converter {
         protected static TypeWriterEnumConverter instance = new TypeWriterEnumConverter();
         private TypeWriterEnumConverter() {}
         public static TypeWriterEnumConverter getInstance() {
              return instance;
         public Object convertDataValueToObjectValue(Object data, Session session) {
              String typeName = (String)data;
              return TWriterType.get(typeName);
         public Object convertObjectValueToDataValue(Object object, Session session) {
              TWriterType type = (TWriterType) object;
              if (type != null) {
                   return type.getName();
              } else {
                   return null;
         public void initialize(DatabaseMapping arg0, Session arg1) {}
         public boolean isMutable() {
              return false;
    }

  • BC4J Custom Type Maps   (MS-SQL cont.)

    (FYI using JDeveloper 9.0.2.0.0, MS-SQL 2000 spk2 and MS-SQL's JDBC driver Version 2.2.0022)
    In the process of trying to get JDeveloper working fully with MS-SQL, I am at the point of developing a custom type map.
    Should this typemap include all mappings or only those different than the "Java" or "Oracle" type map? I was assuming all at first. Now I wonder how it's handling missing mappings.
    How does it find a matching typemap? I noticed that Entity's database column types looked like "int(10,0)" and "bit(1,0)", but in my typemap, like the examples, it's just "INT", "BIT" with no precision, scale. Is this a case of where it's assuming the driver will return a string for type and it's returning type(p,s)? Or is JDev building that string? Either way, would you need a different mapping for "bit(1,0)" than "bit"?
    As "bit(1,0)" it had problems with both the Java map and my custom map. Changing it to "bit" seem to get it to work. So what typemapping was it trying to use as "bit(1,0)"?
    [Bug?] I noticed that when I view the bc4j settings (project (rt-click) -> edit business components project), the value for type map is incorrect if I am using a custom type map. If I am using the Java type map it says "Java" in the greyed out select, but if I am using my custom map ("MS-SQL"), it says "Oracle". I checked the bc4j.xcfg for the one using my custom map and it does say the right class name for jbo.TypeMapEntries.
    On a related note, when testing the bc4j modules, we are instructed to use the edited local configuration, but how do view/edit the project default configuration?
    ====================================================================
    typemap in progress...
    ================================
    public class MsSqlTypeMapEntries
    public MsSqlTypeMapEntries()
    /* ColumnType, JavaClassName, JdbcSqlType, JdbcSqlTypeID, DefaultDisplayLength, isNumericType */
    new JboTypeMap("BIGINT", "java.math.BigInteger", "BIGINT",java.sql.Types.BIGINT,null,true);
    //new JboTypeMap("BIGINT IDENTITY", "java.math.BigInteger", "BIGINT",java.sql.Types.BIGINT,null,true);
    //new JboTypeMap("BINARY BINARY
    new JboTypeMap("BIT","java.lang.Boolean","BIT",java.sql.Types.BIT,null,true);
    new JboTypeMap("CHAR","java.lang.String","CHAR",java.sql.Types.CHAR,null);
    new JboTypeMap("DATETIME" ,"java.sql.Timestamp","TIMESTAMP",java.sql.Types.TIMESTAMP ,null);
    new JboTypeMap("DECIMAL","java.math.BigDecimal","DECIMAL",java.sql.Types.DECIMAL,null,true);
    //new JboTypeMap("DECIMAL() IDENTITY DECIMAL
    //new JboTypeMap("FLOAT FLOAT
    //new JboTypeMap("IMAGE LONGVARBINARY
    new JboTypeMap("INT","java.lang.Integer","INTEGER",java.sql.Types.INTEGER,null,true);
    new JboTypeMap("INT IDENTITY","java.lang.Integer","INTEGER",java.sql.Types.INTEGER,null,true);
    new JboTypeMap("MONEY","java.math.BigDecimal","DECIMAL",java.sql.Types.DECIMAL,null,true);
    new JboTypeMap("NCHAR","java.lang.String","CHAR",java.sql.Types.CHAR,null);
    new JboTypeMap("NTEXT","java.lang.String","LONGVARCHAR", java.sql.Types.LONGVARCHAR, null);
    new JboTypeMap("NUMERIC","java.math.BigDecimal","NUMERIC",java.sql.Types.NUMERIC,null,true);
    //new JboTypeMap("NUMERIC() IDENTITY","java.math.BigDecimal","NUMERIC",java.sql.Types.NUMERIC,null,true);
    new JboTypeMap("NVARCHAR","java.lang.String","VARCHAR",java.sql.Types.VARCHAR,null);
    //new JboTypeMap("REAL REAL
    new JboTypeMap("SMALLDATETIME" ,"java.sql.Date","TIMESTAMP",java.sql.Types.TIMESTAMP ,null);
    new JboTypeMap("SMALLINT","java.lang.Integer","SMALLINT",java.sql.Types.SMALLINT,null,true);
    new JboTypeMap("SMALLINT IDENTITY","java.lang.Integer","SMALLINT",java.sql.Types.SMALLINT,null,true);
    new JboTypeMap("SMALLMONEY","java.math.BigDecimal","DECIMAL",java.sql.Types.DECIMAL,null,true);
    new JboTypeMap("SQL_VARIANT","java.lang.String","VARCHAR",java.sql.Types.VARCHAR,null);
    new JboTypeMap("SYSNAME","java.lang.String","VARCHAR",java.sql.Types.VARCHAR,null);
    new JboTypeMap("TEXT","java.lang.String","LONGVARCHAR", java.sql.Types.LONGVARCHAR, null);
    //new JboTypeMap("TIMESTAMP BINARY
    new JboTypeMap("TINYINT","java.lang.Integer","TINYINT",java.sql.Types.TINYINT,null,true);
    new JboTypeMap("TINYINT IDENTITY","java.lang.Integer","TINYINT",java.sql.Types.TINYINT,null,true);
    new JboTypeMap("UNIQUEIDENTIFIER","java.lang.String","CHAR",java.sql.Types.CHAR,null);
    //new JboTypeMap("VARBINARY VARBINARY
    new JboTypeMap("VARCHAR","java.lang.String","CHAR",java.sql.Types.CHAR,null);
    }

    (FYI using JDeveloper 9.0.2.0.0, MS-SQL 2000 spk2 and MS-SQL's JDBC driver Version 2.2.0022)
    In the process of trying to get JDeveloper working fully with MS-SQL, I am at the point of developing a custom type map.
    Should this typemap include all mappings or only those different than the "Java" or "Oracle" type map? I was assuming all at first. Now I wonder how it's handling missing mappings.
    How does it find a matching typemap? I noticed that Entity's database column types looked like "int(10,0)" and "bit(1,0)", but in my typemap, like the examples, it's just "INT", "BIT" with no precision, scale. Is this a case of where it's assuming the driver will return a string for type and it's returning type(p,s)? Or is JDev building that string? Either way, would you need a different mapping for "bit(1,0)" than "bit"?
    As "bit(1,0)" it had problems with both the Java map and my custom map. Changing it to "bit" seem to get it to work. So what typemapping was it trying to use as "bit(1,0)"?
    [Bug?] I noticed that when I view the bc4j settings (project (rt-click) -> edit business components project), the value for type map is incorrect if I am using a custom type map. If I am using the Java type map it says "Java" in the greyed out select, but if I am using my custom map ("MS-SQL"), it says "Oracle". I checked the bc4j.xcfg for the one using my custom map and it does say the right class name for jbo.TypeMapEntries.
    On a related note, when testing the bc4j modules, we are instructed to use the edited local configuration, but how do view/edit the project default configuration?
    ====================================================================
    typemap in progress...
    ================================
    public class MsSqlTypeMapEntries
    public MsSqlTypeMapEntries()
    /* ColumnType, JavaClassName, JdbcSqlType, JdbcSqlTypeID, DefaultDisplayLength, isNumericType */
    new JboTypeMap("BIGINT", "java.math.BigInteger", "BIGINT",java.sql.Types.BIGINT,null,true);
    //new JboTypeMap("BIGINT IDENTITY", "java.math.BigInteger", "BIGINT",java.sql.Types.BIGINT,null,true);
    //new JboTypeMap("BINARY BINARY
    new JboTypeMap("BIT","java.lang.Boolean","BIT",java.sql.Types.BIT,null,true);
    new JboTypeMap("CHAR","java.lang.String","CHAR",java.sql.Types.CHAR,null);
    new JboTypeMap("DATETIME" ,"java.sql.Timestamp","TIMESTAMP",java.sql.Types.TIMESTAMP ,null);
    new JboTypeMap("DECIMAL","java.math.BigDecimal","DECIMAL",java.sql.Types.DECIMAL,null,true);
    //new JboTypeMap("DECIMAL() IDENTITY DECIMAL
    //new JboTypeMap("FLOAT FLOAT
    //new JboTypeMap("IMAGE LONGVARBINARY
    new JboTypeMap("INT","java.lang.Integer","INTEGER",java.sql.Types.INTEGER,null,true);
    new JboTypeMap("INT IDENTITY","java.lang.Integer","INTEGER",java.sql.Types.INTEGER,null,true);
    new JboTypeMap("MONEY","java.math.BigDecimal","DECIMAL",java.sql.Types.DECIMAL,null,true);
    new JboTypeMap("NCHAR","java.lang.String","CHAR",java.sql.Types.CHAR,null);
    new JboTypeMap("NTEXT","java.lang.String","LONGVARCHAR", java.sql.Types.LONGVARCHAR, null);
    new JboTypeMap("NUMERIC","java.math.BigDecimal","NUMERIC",java.sql.Types.NUMERIC,null,true);
    //new JboTypeMap("NUMERIC() IDENTITY","java.math.BigDecimal","NUMERIC",java.sql.Types.NUMERIC,null,true);
    new JboTypeMap("NVARCHAR","java.lang.String","VARCHAR",java.sql.Types.VARCHAR,null);
    //new JboTypeMap("REAL REAL
    new JboTypeMap("SMALLDATETIME" ,"java.sql.Date","TIMESTAMP",java.sql.Types.TIMESTAMP ,null);
    new JboTypeMap("SMALLINT","java.lang.Integer","SMALLINT",java.sql.Types.SMALLINT,null,true);
    new JboTypeMap("SMALLINT IDENTITY","java.lang.Integer","SMALLINT",java.sql.Types.SMALLINT,null,true);
    new JboTypeMap("SMALLMONEY","java.math.BigDecimal","DECIMAL",java.sql.Types.DECIMAL,null,true);
    new JboTypeMap("SQL_VARIANT","java.lang.String","VARCHAR",java.sql.Types.VARCHAR,null);
    new JboTypeMap("SYSNAME","java.lang.String","VARCHAR",java.sql.Types.VARCHAR,null);
    new JboTypeMap("TEXT","java.lang.String","LONGVARCHAR", java.sql.Types.LONGVARCHAR, null);
    //new JboTypeMap("TIMESTAMP BINARY
    new JboTypeMap("TINYINT","java.lang.Integer","TINYINT",java.sql.Types.TINYINT,null,true);
    new JboTypeMap("TINYINT IDENTITY","java.lang.Integer","TINYINT",java.sql.Types.TINYINT,null,true);
    new JboTypeMap("UNIQUEIDENTIFIER","java.lang.String","CHAR",java.sql.Types.CHAR,null);
    //new JboTypeMap("VARBINARY VARBINARY
    new JboTypeMap("VARCHAR","java.lang.String","CHAR",java.sql.Types.CHAR,null);
    }

  • Data type mapping

    Hi,
    Where can I map the java datatype to its equivalent DB datatype. I think for Oracle, MS SQL server,Sysbase there is default type mapping.

    Jagan wrote:
    Great Joe,
    Thanks for ur immediate response.:-)
    I have few issues here :
    1.) Tell me whether i can use Postgres with weblogic6.1 and above versions.Weblogic supports any JDBC driver to any DBMS, as long as the JDBC driver
    implements the standard JDBC spec, and is threadsafe.
    2.)Can i create tables using weblogic and Postgres?if yes,how?Surely, via the SQL commands Postgres understands, and JDBC:
    statement.executeUpdate("create table myTable(myInt int, myName varchar(30), ...)");
    3.)If no support is provided,please tell whether weblogic support only the four
    Databases mentioned in the doc,explain clearly.BEA is totally devoted to the J2EE standards. We must support any driver and
    DBMS that also meets the J2EE spec.
    4.)Is there no way i can specify datatype mapping using the weblogic API also?
    Application servers like JBoss provide us with a xml where we specify the datatype
    mappings for each database,is there something like that for weblogic?no.
    Else provide me with a solution.I'm not sure what your exact desire is. For a given DBMS there are a unique
    set of column types. There is some overlap across DBMSes, and there is
    usually some types that are unique to the DBMS, and some that are generic
    in purpose, such as date-time values, that is implemented differently in each
    DBMS.
    For each DBMS there is one or more JDBC drivers. Each driver will convert
    a given DBMS column type to any logically convertable JDBC type. Ie:
    an integer column in the DBMS can be asked for via getString(), and the
    driver will convert the value 123 to "123". Drivers will also decide what
    JDBC type to create from a given DBMS column. If a column value is
    asked for via getObject(), the driver will make what it thinks is the best
    Java type to represent the column. There is a JDBC spec for this, but many
    drivers diverge from the spec.
    What do you need, and how can we help?
    Once again thanks for ur response,expecting the same again.Sure.
    Joe Weinstein
    Thanks & Regds,
    --Jagan.
    Joseph Weinstein <[email protected]> wrote:
    Hi. No, we don't have a Postgres-Oracle,Oracle-postgres conversion
    chart. Sorry.
    Joe
    Jagan wrote:
    Joseph Weinstein <[email protected]> wrote:
    Jagan wrote:
    Hi,
    Where can I map the java datatype to its equivalent DB datatype.
    I
    think for Oracle, MS SQL server,Sysbase there is default type mapping.
    You will have to check the driver documentation for each DBMS driver
    you use. There are too many deviations from the
    JDBC spec to rely on it. For instance if you create an Oracle tablewith
    an int column, if you do a getObject() to fetch
    it's value, the Oracle driver will provide a BigDecimal object.
    Joe
    Hi Joe,
    I think there is a big misunderstanding after seeing your reply.
    What i meant was :
    I am actually porting an application to weblogic6.1 and Postgre databasewhich
    deployed and executed succesfully using weblogic6.1 and Oracle.
    Here i face the problem of Datatype mapping for Postgres.
    What i wanted is,is there a file or xml in weblogic where i can specifythe datatype
    mapping for each database?
    If yes,where and how do i do that,explain me with a sample plaese.
    Please do not be specific to any database,because i am porting thesame application
    to many databases,so please answer me in
    generic.
    Thanks in Advance,
    --Jagan.

  • How can I map CHAR jdbc type to the char java type

    Hi,
    I would like to make all changes in the DB schema file and use source
    generation tools as a process. Now I foound that JDBC integer type
    corresponds to the Java int type. But having:
    <column name="ACTIVATION_STATUS" type="char" not-null="true" size="1"/>
    The generated class field is of String type:
    class .... {
         private String activationStatus;
    What is the proper way to have it mapped to char type fixing schema file
    only?
    Thanks in advance,
    Anton

    Abe White wrote:
    I don't think any schema XML will reverse map to a char type. You'd
    have to create a reverse mapping customization properties file as
    described here:>
    http://www.solarmetric.com/Software/Documentation/latest/docs/ref_guide_pc_reverse.html#ref_guide_pc_reverse_custom
    Thank you,
    Anton

  • SQL user defined type mapping with Java Class type

    SECRET_TAB_TYPE is userdefined type in SQL Schema. but accessing this way it is giving invalid column type error(see code below )??
    I have made a class with same name attributes as in SQL Type
    Connection con = DriverManager.getConnection(URL,Username, Password );
    java.util.Map map = con.getTypeMap();
    map.put("SchemaName.SECRET_TAB_TYPE",Class.forName("SECRET_TAB_TYPE"));
    CallableStatement pstmt = con.prepareCall( "{ call smartapi.FetchSharedSecret(?,?,?,?,?,?) }" );
    pstmt.setString(1,"SM");
    pstmt.setString(2,"BT");
    pstmt.setString(3,"COM");
    pstmt.registerOutParameter(4, Types.JAVA_OBJECT);//
    pstmt.registerOutParameter(5,Types.VARCHAR);
    pstmt.executeQuery();
    secret_tab=(SECRET_TAB_TYPE)pstmt.getObject(4);
    message= pstmt.getString(5);

    STATS_T_TEST_
    docs.oracle.com/cd/B19306_01/server.102/b14200/functions157.htm 
    STATS_T_TEST_ONE: A one-sample t-test
    STATS_T_TEST_PAIRED: A two-sample, paired t-test (also known as a crossed t-test)
    STATS_T_TEST_INDEP: A t-test of two independent groups with the same variance (pooled variances)
    STATS_T_TEST_INDEPU: A t-test of two independent groups with unequal variance (unpooled variances)

  • ADF Business Component Type MAP Oracls vs Java

    what the advantages and disadvantages from each one map type
    thank in advance

    Take a look at this link in developer's guide:
    http://docs.oracle.com/cd/E16162_01/web.1112/e16182/bcintro.htm#sm0062
    The Java Extended for Oracle type map and the Oracle Domains type map handle numeric data differently. When you create a new application the default type map Java Extended for Oracle maps numeric data to the java.math.BigDecimal >class, which inherits from java.math.Number. The java.math.BigDecimal default matches the way the Fusion web application view layer, consisting of ADF Faces components, preserves alignment of numeric data (such as numeric values >displayed by ADF Faces input fields in a web page). Whereas the Oracle Domains type map, which maps numeric data to the oracle.jbo.domain.Number class, may not display the data with the alignment expected by certain ADF Faces >components. Aside from this alignment issue, the Oracle Domains type map remains a valid choice and applications without ADF Faces components will function without issue.Thanks,
    Navaneeth

  • Number field type mapped as String

    Oracle Number field is mapped as CSTRING when using CRECORDSET class in VC++.
    Any ideas why? or what I should do?

    How big is the number column defined? ANything larger than a NUMBER(14) will map to a character string since there isn't a datatype large enough to hold say a NUMBER(30).
    Here is the mapping as I rememeber it (it is old information and may not be quite up to date with the latest drivers):
    if Scale = 0 then if Precision <= 4 then
    Number Size: Integer
    if Precision <= 9 then Number Size: Long
    Integer
    if Precision <= 15 then Number Size: Double
    if Scale > 0 then if Precision <= 15 then
    Number Size: Double
    Any other field types mapped to Text (Field
    Size = 255).

  • The JNI defines a mapping of Java types and native (C/C++) types.

    As per the tutorial
    The JNI defines a mapping of Java types and native (C/C++) types.Does the above sentence mean that I can use dll written in C/C++ only and not dll written in Pearl.
    Could anyone please give me the solution.

    Please do tell me how can I call a dll file created in Perl ....And I will point out again that I doubt that it is possible to create a dll that has the following characteristics
    1. Is in fact a dll.
    2. Is in fact intended to run anywhere outside of the perl engine.
    Step 2 means that you run perl, not a "perl dll" via C.
    You can do that or at least in the past you could. And that has nothing to do with java nor JNI. So you would learn about it on a perl site.
    And I can only note that when I did that a number of years ago it was very difficult. Certainly much harder than getting JNI to work. And you had better have quite a bit of C/C++ experience before you attempt it.

  • JPA - Columns to java.util.Map

    I need to map the columns of a DB table into a java.util.Map object.
    Any idea about how to implement this feature?
    These are the columns of my table:
       | ID | Value01 | Value02 | Value03 | ... | ValueN |I'd like to obtain a bean like this:
    public class MyBean {
      private String ID;
      private Map values;
    }I thought I could extend java.util.Map and redefine the get(Object) and put(Object, Object) methods
    (I did something like this in java 1.4) but I can't figure it out in 1.5 with JPA

    >
    hi i have the following method,when i click my button am geting this error java.lang.String cannot be cast to java.util.Map
    >
    And that is correct - you can't do that cast. Which is what this code is trying to do.
    >
    (Map)actionEvent.getComponent().getAttributes().get("test")
    >
    Ask yourself what object is supposed to be the 'Map' in that line of code?
    Is it 'actionEvent', 'getComponent()' or 'getAttributes()'?
    My guess is that it is the 'getAttributes' that returns a map. Which means you need to cast
    actionEvent.getComponent().getAttributes()as a Map. Which means you need to put that entire thing in parentheses so that the cast is performed on it. And then you have to put THAT entire thing in parentheses so you can call the 'get' method on it.
    So this is the 'Map'
    (Map) (actionEvent.getComponent().getAttributes())And this calls the Maps 'get' method
    ( (Map) (actionEvent.getComponent().getAttributes()) ).get("test")If you broke the line into pieces and stored each piece in its own variable you would see it. These object types may not be right but should give you the idea.
    //( (Map) (actionEvent.getComponent().getAttributes()).get("test") ).get("test")
    MyComponent myComponent = (MyComponent) actionEvent.getComponent();
    Map myMap = (Map) myComponent.getAttributes();
    myMap.get("test");

  • PL/SQL Evaluation problem of where clause in case of  NUMBER column type

    I found the following problem in Oracle® Database 2 Day Developer's Guide 11g Release 1 (11.1) B28843-04:
    The sole parameter of function eval_frequency is employee_id IN employees.employee_id%TYPE.
    An ORA-01422 exception occurs when the execution reaches the following select command
    SELECT e.hire_date
    INTO hire_date
    FROM employees e
    WHERE employee_id= e.employee_id;
    A possible cause of the error is that the type of employee_id is NUMBER while the employees.employee_id is NUMBER(6,0) . The result of the selection is the same as there were no WHERE clause at all.
    Everything worked fine, when I declared a temporary variable of NUMBER(6,0) for storing the actual parameter of function and used this variable in the where clause, but I consider this "solution" as being no solution.
    It is pointless to use %TYPE parameter of a function for flexibility if I must degrade this flexibility by a fixed declaration of a temporary variable of the same type as the column in question.
    What is wrong?
    The Developer'Guide I used, the Oracle Sql Developer I used or the PL/SQL version ?

    Hi,
    Welcome to the forum!
    user8949829 wrote:
    A possible cause of the error is that the type of employee_id is NUMBER while the employees.employee_id is NUMBER(6,0) . The result of the selection is the same as there I don't think so. The variable employee_id is defined as having the exact same type as the eponymous column. Even if it didn't, I believe Oracle will always implicity convert between datatypes when possible, rounding if necessary. That may cause errors, but it isn't causing this error.
    No, the error has nothing to do with the data type. It has to do with the ambiguity of employee_id: is it a column, or is it a variable?
    The default is that it means the column name, so
    WHERE   employee_id = e.employee_idis equivalent to saying
    WHERE   e.employee_id = e.employee_idwhich isn't quite the same thing as not having a WHERE clause; rows with NULL employee_id would still be excluded, if there were any.
    I think it's best not to use variable names that are the same as column names. You could call the variable v_employee_id, or, since it's an IN-argument, in_employee_id.
    If you must use a variable that can be mistaken for a column, then qulaify it with the name of the procedure, like this:
    WHERE   eval_frequency.employee_id = e.employee_id
    Everything worked fine, when I declared a temporary variable of NUMBER(6,0) for storing the actual parameter of function That makes sens. You probably gave that variable a name that couldn't be mistaken for a column in the table.
    Edited by: Frank Kulash on Jan 12, 2011 8:27 PM

  • Java.io.IOException: unable to find the type mapping resource file

    Hi,
    I am using weblogic7.0 to deploy my applications. I wrote a web service and
    was able to deploy it sucessfully. I am trying to access the web service through
    a jsp page. I am the error posted below on my server and " error:505 internal
    server error" on the browser. Can any one please help me out with the problem.
    My jsp page just displays the float value i am returing from the session bean
    method.
    Thanks,
    Ramya.
    <Apr 14, 2003 4:32:51 PM PDT> <Error> <HTTP> <101019> <[ServletContext(id=64204
    55,name=bankwebapp,context-path=/bankwebapp)] Servlet failed with IOException
    java.io.IOException: unable to find the type mapping resource file for:bank.Ban
    kService
    at weblogic.webservice.core.encoding.DefaultRegistry.<init>(DefaultRegi
    stry.java:62)
    at weblogic.webservice.core.rpc.ServiceImpl.<init>(ServiceImpl.java:72)
    at bank.BankService_Impl.<init>(BankService_Impl.java:23)
    at jsp_servlet.__getbal._jspService(__getbal.java:106)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.ru
    n(ServletStubImpl.java:1058)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI
    mpl.java:401)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI
    mpl.java:445)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI
    mpl.java:306)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActi
    on.run(WebAppServletContext.java:5412)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServi
    ceManager.java:744)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppS
    ervletContext.java:3086)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestI
    mpl.java:2544)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
    >
    <Apr 14, 2003 4:40:59 PM PDT> <Notice> <Application Poller> <149400> <Activatin
    g application: appsdirbankwebapp_war>
    <Apr 14, 2003 4:40:59 PM PDT> <Notice> <Application Poller> <149404> <Activate
    application appsdirbankwebapp_war on myserver - Running>
    <Apr 14, 2003 4:41:01 PM PDT> <Notice> <Application Poller> <149404> <Activate
    application appsdirbankwebapp_war on myserver - Completed>
    The url value from the jsp page ishttp://localhost:7001
    The wsdl value from the jsp page ishttp://localhost:7001/web_services/BankServi
    ce
    <Apr 14, 2003 4:41:06 PM PDT> <Error> <HTTP> <101019> <[ServletContext(id=72463
    20,name=bankwebapp,context-path=/bankwebapp)] Servlet failed with IOException
    java.io.IOException: unable to find the type mapping resource file for:bank.Ban
    kService
    at weblogic.webservice.core.encoding.DefaultRegistry.<init>(DefaultRegi
    stry.java:62)
    at weblogic.webservice.core.rpc.ServiceImpl.<init>(ServiceImpl.java:72)
    at bank.BankService_Impl.<init>(BankService_Impl.java:23)
    at jsp_servlet.__getbal._jspService(__getbal.java:106)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.ru
    n(ServletStubImpl.java:1058)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI
    mpl.java:401)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI
    mpl.java:445)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI
    mpl.java:306)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActi
    on.run(WebAppServletContext.java:5412)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServi
    ceManager.java:744)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppS
    ervletContext.java:3086)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestI
    mpl.java:2544)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
    >

    Hi Manoj,
    Thanks a lot for your hepl. I tried as you said and its working now.
    Ramya
    "manoj cheenath" <[email protected]> wrote:
    Make sure that you put the client jar file generated by
    clientgen in the lib directory of the jsp web app.
    It looks like the runtime is unable to load
    <service>.xml type mapping file. This xml file
    should be in the classpath (web-inf/lib or
    web-inf/classes).
    -manoj
    "Ramya" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    I am using weblogic7.0 to deploy my applications. I wrote a web serviceand
    was able to deploy it sucessfully. I am trying to access the web servicethrough
    a jsp page. I am the error posted below on my server and " error:505internal
    server error" on the browser. Can any one please help me out with theproblem.
    My jsp page just displays the float value i am returing from the sessionbean
    method.
    Thanks,
    Ramya.
    <Apr 14, 2003 4:32:51 PM PDT> <Error> <HTTP> <101019><[ServletContext(id=64204
    55,name=bankwebapp,context-path=/bankwebapp)] Servlet failed withIOException
    java.io.IOException: unable to find the type mapping resource filefor:bank.Ban
    kService
    atweblogic.webservice.core.encoding.DefaultRegistry.<init>(DefaultRegi
    stry.java:62)
    atweblogic.webservice.core.rpc.ServiceImpl.<init>(ServiceImpl.java:72)
    at bank.BankService_Impl.<init>(BankService_Impl.java:23)
    at jsp_servlet.__getbal._jspService(__getbal.java:106)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    atweblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.ru
    n(ServletStubImpl.java:1058)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI
    mpl.java:401)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI
    mpl.java:445)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI
    mpl.java:306)
    atweblogic.servlet.internal.WebAppServletContext$ServletInvocationActi
    on.run(WebAppServletContext.java:5412)
    atweblogic.security.service.SecurityServiceManager.runAs(SecurityServi
    ceManager.java:744)
    atweblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppS
    ervletContext.java:3086)
    atweblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestI
    mpl.java:2544)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
    >
    <Apr 14, 2003 4:40:59 PM PDT> <Notice> <Application Poller> <149400><Activatin
    g application: appsdirbankwebapp_war>
    <Apr 14, 2003 4:40:59 PM PDT> <Notice> <Application Poller> <149404><Activate
    application appsdirbankwebapp_war on myserver - Running>
    <Apr 14, 2003 4:41:01 PM PDT> <Notice> <Application Poller> <149404><Activate
    application appsdirbankwebapp_war on myserver - Completed>
    The url value from the jsp page ishttp://localhost:7001
    The wsdl value from the jsp page
    ishttp://localhost:7001/web_services/BankServi
    ce
    <Apr 14, 2003 4:41:06 PM PDT> <Error> <HTTP> <101019><[ServletContext(id=72463
    20,name=bankwebapp,context-path=/bankwebapp)] Servlet failed withIOException
    java.io.IOException: unable to find the type mapping resource filefor:bank.Ban
    kService
    atweblogic.webservice.core.encoding.DefaultRegistry.<init>(DefaultRegi
    stry.java:62)
    atweblogic.webservice.core.rpc.ServiceImpl.<init>(ServiceImpl.java:72)
    at bank.BankService_Impl.<init>(BankService_Impl.java:23)
    at jsp_servlet.__getbal._jspService(__getbal.java:106)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    atweblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.ru
    n(ServletStubImpl.java:1058)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI
    mpl.java:401)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI
    mpl.java:445)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubI
    mpl.java:306)
    atweblogic.servlet.internal.WebAppServletContext$ServletInvocationActi
    on.run(WebAppServletContext.java:5412)
    atweblogic.security.service.SecurityServiceManager.runAs(SecurityServi
    ceManager.java:744)
    atweblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppS
    ervletContext.java:3086)
    atweblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestI
    mpl.java:2544)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
    >

  • Mapping Java Types to XML Types

    Hi, I have a small doubt in web services,
    1)  how a java data type can match with xml data type in wsdl,
    2)  how and where the java program can find the matching java
        data type to xml data type and vice versa
    3)  whether any mechanism is available for this data conversion?
    4)  where can i find that one?
    Please advice me
    Regards
    Marimuthu.N

    Hi Marimuthu.N,
    My answers for your question, Kindly let me know if you need some more inputs.
    +1) how a java data type can match with xml data type in wsdl,+
    In SOAP 1.1 you have the following data types which is in XSD(XML Schema Definition), the same data type is also available in Java. For example (string, normalizedstring in xml is available as java.lang.String)
    The complete list can be found in the table below.
    XSD to Java Mapping.
    XSD Type--------------------------------Java Type
    base64Binary----------------------------byte[]
    hexBinary---------------------------------byte[]
    boolean------------------------------------Boolean
    byte-----------------------------------------Byte
    dateTime----------------------------------java.util.Calendar
    date-----------------------------------------java.util.Calendar
    time-----------------------------------------java.util.Calendar
    decimal------------------------------------java.math.BigDecimal
    double-------------------------------------Double
    float-----------------------------------------Float
    hexBinary---------------------------------byte[]
    int--------------------------------------------Int
    unsignedShort---------------------------Int
    integer--------------------------------------java.math.BigInteger
    long------------------------------------------Long
    unsignedInt-------------------------------Long
    QName-------------------------------------javax.xml.namespace.QName
    short----------------------------------------Short
    unsignedByte---------------------------Short
    string---------------------------------------java.lang.String
    anySimpleType-------------------------java.lang.String
    +2) how and where the java program can find the matching java+
    data type to xml data type and vice versa
    Here is my WSDL which has a method getHello --> Pass Input as String --> Get Response as String.
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions targetNamespace="http://zackria.googlepages.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://zackria.googlepages.com" xmlns:intf="http://zackria.googlepages.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <!--WSDL created by Apache Axis version: 1.4
    Built on Apr 22, 2006 (06:55:48 PDT)-->
    <wsdl:types>
      <schema elementFormDefault="qualified" targetNamespace="http://zackria.googlepages.com" xmlns="http://www.w3.org/2001/XMLSchema">
       <element name="getHello">
        <complexType>
         <sequence>
          <element name="s" type="xsd:string"/>
         </sequence>
        </complexType>
       </element>
       <element name="getHelloResponse">
        <complexType>
         <sequence>
          <element name="getHelloReturn" type="xsd:string"/>
         </sequence>
        </complexType>
       </element>
      </schema>
    </wsdl:types>
       <wsdl:message name="getHelloResponse">
          <wsdl:part element="impl:getHelloResponse" name="parameters"/>
       </wsdl:message>
       <wsdl:message name="getHelloRequest">
          <wsdl:part element="impl:getHello" name="parameters"/>
       </wsdl:message>
       <wsdl:portType name="Test">
          <wsdl:operation name="getHello">
             <wsdl:input message="impl:getHelloRequest" name="getHelloRequest"/>
             <wsdl:output message="impl:getHelloResponse" name="getHelloResponse"/>
          </wsdl:operation>
       </wsdl:portType>
       <wsdl:binding name="TestSoapBinding" type="impl:Test">
          <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
          <wsdl:operation name="getHello">
             <wsdlsoap:operation soapAction=""/>
             <wsdl:input name="getHelloRequest">
                <wsdlsoap:body use="literal"/>
             </wsdl:input>
             <wsdl:output name="getHelloResponse">
                <wsdlsoap:body use="literal"/>
             </wsdl:output>
          </wsdl:operation>
       </wsdl:binding>
       <wsdl:service name="TestService">
          <wsdl:port binding="impl:TestSoapBinding" name="Test">
             <wsdlsoap:address location="http://localhost:8080/TestWebService/services/Test"/>
          </wsdl:port>
       </wsdl:service>
    </wsdl:definitions>I use apache axis for the client side code. I also suggest to start using this to get quickly into SOA(Service Oriented Architecture)
    package com.googlepages.zackria;
    import org.apache.axis.client.Call;
    import org.apache.axis.client.Service;
    import javax.xml.namespace.QName;
    * TestClient for Webservice
    * @author $author$Mohammed Zackria
    * @version $Revision$1.00
    public class TestClient {
         * main method
         * @param args pass nothing as far now
        public static void main(String[] args) {
            try {
                String endpoint = "http://localhost:8080/TestWebService/services/Test";
                Service service = new Service();
                Call call = (Call) service.createCall();
                call.setTargetEndpointAddress(new java.net.URL(endpoint));
                call.setOperationName(new QName("http://zackria.googlepages.com", "getHello"));
                //String Conversion
                String ret = (String) call.invoke(new Object[] { "Zack" });
                System.out.println("Sent 'Zack', got '" + ret + "'");
            } catch (Exception e) {
                System.err.println(e.toString());
    }+3) whether any mechanism is available for this data conversion?+
    Check the above code which has the following portion
    //String Conversion
    String ret = (String) call.invoke(new Object[] { "Zack" });
    By default APACHE Axis returns Object Array which can be Casted to your WSDL defined data type.
    +4) where can i find that one?+
    [Eclipse Webservice|http://www.eclipse.org/webtools/jst/components/ws/1.5/tutorials/BottomUpWebService/BottomUpWebService.html]
    Hope this helps out, Kindly Let me know if you need some more or if i have not answered your question.
    Regards,
    Zack
    Edited by: zack on Nov 22, 2008 1:47 PM
    Edited by: zack on Nov 22, 2008 1:49 PM

  • Java.util.Map type return in webservice method

    Wonder, how we can return a java.util.Map type from a webservice deployed on a
    weblogic 7.x environment..
    any input is appreciated.
    -Girish

    Thanks Michael. it helps.
    -Girish
    "Michael Wooten" <[email protected]> wrote:
    >
    Hi Girish,
    By definition, a Java object used as a input parameter (or return type)
    of a web
    service operation, must has a no-arg constructor in order for a Java-based
    Web
    Service Stack to serialize/deserialize it to/from XML. java.util.Map
    is an interface,
    so it does not meet this requirement :-)
    If your web service operation is just trying to return (or accept) a
    hash map
    of "arbitrary complex types", I recommend that you consider switching
    this to
    be an "array of arrays of specific complex types". The reason I say this
    is because,
    it allows even non-Java consumers to look at the <schema> elements in
    your web
    services' WSDL, and figure out all the possible "arbitrary complex types"
    that
    might be in this array. If you envision the consumer getting a box, where
    it can
    literally contain anything, you can probably see how much more code they
    would
    need to write, than if they knew the the box contained a box of these,
    and a box
    of these, and so on, and so on.
    Basically, all the "old school" type-safety rules still apply to web
    services
    computing. If you want web services with descent performance metrics,
    you're probably
    going to want to keep a lot of the "old school, distributed computing"
    practices
    in mind, when you design your stuff :-)
    That said, WLS 7.0 SP1 does not currently have a "built-in" HashMap codec.
    But,
    you could create one using the information at:
    http://edocs.bea.com/wls/docs70/webserv/customdata.html#1054435
    Regards,
    Mike Wooten
    "girish" <[email protected]> wrote:
    Wonder, how we can return a java.util.Map type from a webservice deployed
    on a
    weblogic 7.x environment..
    any input is appreciated.
    -Girish

Maybe you are looking for

  • How to call text file using Script in Data Integrator

    Dear All, Can any one assit me in how to call a text file using script with the help of Data Integrator. and one question ? M having 32 csv files i want to club thos 32 csv files into one table with the help of Data Integrator, can any one assist me.

  • Transferring receivables to pca

    My issue is as follows: We have Custome invoice 102345789 Debit Customer 1000 Credit Rev Acct 1000     Pctr :abcd At month end when we transfer recivables to pca by doing F.5 d and 1kek customer line item should acquire profit center form the revenue

  • ODI - issue executing a SP against tables in different oracle instance....

    Hello Gurus, I have written a SP in an ODI Procedure [not calling an SP]. The tables are located in the ODIDEV schema on another Oracle instance. I have successfully used the same SP but my odidev schema has been on the same oracle instance as my oth

  • Archiving Successfuly processed messages

    Hi All Problem Area = Not able to Archive Successfuly processed messages for Inbound messages. I have to archive successfully processed messages both Outbound messages and Inbound messages. I am going into SXMB_ADM --> Define Interfaces for Archiving

  • Deallock detection in rac

    Hi All, We have a 2 node rac database. client used to run a load everyday on PROD database. Everyday they are getting a deadlock issue because of which they have rerun a job. The load takes more time as expected. When i checked the alert log i found