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.
Similar Messages
-
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?
MarkusHi 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;
} -
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
CarloThat 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. -
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);
} -
Need Java Coding to sent File in a Mail Attachment with MIME Type with SMTP
Hi Experts,
I need java code to sent a file in an email attachment with MIME type.
Please provide me.
TYhanks
BhaskarHi Stefan,
Thanks for your Blog.
The same java mapping is been used in my current system, but the legacy system cannot read
some emails as they are asking us to send the email in MIME format.
Already i am sending in MIME format itself.
They can read some Emails and they cannot ream some Emails.
I think the problem could be their exchange server.
Can you please suggest on this.
Regards,
Bhaskar -
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)
> -
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 advanceTake 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 -
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.NHi 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 -
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. -
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.
-GirishThanks 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 -
(262119469) Q DBC-17 How is data mapped from SQL-type to Java-type?
Q<DBC-17> Is there any documentaion for the data mapping between the "java type" and
the "sql type"
A<DBC-17> The data types are the standard JDBC mappings. Check the javadoc for the
java.sql package.Hi,
If you are seeing last 3 fields coming as empty.... then you need to check the seperator type which correctly seperats one fields from another during mapping to BW infoobject.
Thanks
Kishore Kusupati -
@XmlAttribute/@XmlValue need to reference a Java type that maps to text
Hi,
I get this exception when marshalling with xjc (either 2.0.1 or 2.1.3) generated classes. The xsd looks like this:
<xs:complexType name="ExtensionType">
<xs:simpleContent>
<xs:extension base="xs:anySimpleType">
<xs:attribute name="nombre" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="tipo" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="0"/>
<xs:maxLength value="30"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="id" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="0"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>and the generated class looks like
public class ExtensionType {
@XmlValue
protected Object value;
@XmlAttribute
protected String id;
@XmlAttribute(required = true)
protected String nombre;
@XmlAttribute
protected String tipo;
}If I change value's type to String I don't get the error any more. I've tried some binding customizations, but without luck.
Any hints on how to a) customize de binding or b) modify the schema so that jaxb doesn't choke on xjc's bindings?
tksI am running into the same problem. I need an @XmlValue to be an Object (xs:anyType). Here are the basic annotations:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "argument")
public class Argument {
@XmlAttribute(name = "type")
protected String type;
@XmlValue
protected Object value;
}The desired output is as follows:
<argument type="arg1.type" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">
test
</argument>However, I am getting the same exception: "@XmlAttribute/@XmlValue need to reference a Java type that maps to text in XML." when attempting to marshal.
Any suggestions would be appreciated. -
Where can I find a mapping chart between Oracle and Java types?
Thanks,
Jean-Philippe Doucethttp://java.sun.com/products/jdk/1.1/docs/guide/jdbc/getstart/mapping.doc.html
-
Type-mapping not working correctly, get "Unable to find a javaType for the xmlType" WARNING
I'm manually creating a web-services.xml file, and using the autogen ant task to
generate the codec XML/Java classes. The XML definition is provided by SAP.
The ant build.xml file:
<project name="buildWebservice" default="stubgen">
<target name="stubgen">
<clientgen ear="C:\projects\RMIS\ifrrequests\RMIS.ear"
packageName="com.aa.rmis.webservice.client"
clientJar="C:\projects\RMIS\ifrrequests\rmisws-client.jar"
autotype="False" />
</target>
<target name="all" depends="stubgen"/>
</project>
The problem is seen below in the output from Ant. Note the WARNINIG. The problem
is that the xml type cannot be mapped to the Java type.
C:\projects\RMIS\ifrrequests>ant -buildfile clientbuild.xml
Buildfile: clientbuild.xml
stubgen:
[clientgen] Generating client jar for RMIS.ear ...
[clientgen] WARNINIG: Unable to find a javaType for the xmlType:['urn:sap-com:do
cument:sap:business']:PaymentRequest.Create. Make sure that you have registered
this xml type in the type mapping
[clientgen] Using SOAPElement instead
[clientgen] Compiling 4 source files to C:\DOCUME~1\944377\LOCALS~1\Temp\rmisws-
client.jar-836624340
[clientgen] Building jar: C:\projects\RMIS\ifrrequests\rmisws-client.jar
BUILD SUCCESSFUL
Total time: 17 seconds
The Java source that has the implementation of the service methods is simply:
package com.aa.rmis.webservice;
import com.aa.rmis.ifr.request.*;
public class TestService
public TestService()
public int serviceRequest(PaymentRequestCreate request)
System.out.println("Received serviceRequest message");
return 0;
public void testStringRequest(String request)
The web-service.xml file is attached, which contains the schema for the SAP PaymentRequest.Create
object definition.
Another problem I have, which is probably related, is that the service method
that has a complex data type (non-built in data type) is not being deployed into
the WebLogic server. But the other service method that simply takes a String
parameter is.
The steps I took are:
1. Get XML from SAP Interface Repository (IFR) for PaymentRequest
2. Use ant task autogen to generate the request codec classes
3. Create the web-services.xml file by inserting the schema definition and the
mapping file created by the autogen task, and defining the operations
4. Build web-services.war file that contains all autogen compiled class files,
the web-services.xml file, and the service implementation class
5. Build the ear file that holds the web service files
6. Use the clientgen ant task to generate (included above) to generate the client
jar file that should contain the proxy for both of the service methods
Environment:
* WebLogic 7.02
* JDK 1.3.1_06
* JBuilder 9 Enterprise
* Ant 1.4
Possible causes:
* Namespace not being used correctly
* copied verbatim the mapping xml file generated by autogen into the web-services.xml
file
* xml-schema part of web-services.xml might not be set correctly
* operation definition might not be using the correct namespace
* Classpath used for ant might not be right
* Doubt this is the problem, but I'm out of other ideas
* Set by using the setWLEnv.cmd file provided by WebLogic
* Tried adding the generated classes directory for my project to the classpath,
but did not work
I've been referencing the Programming WebLogic Web Services document throughout
this entire process. I must be missing something.
Can anybody from BEA help me out with this problem?
Thanks in advance.
[web-services.xml]Hi JD,
I spent a few cycles looking over your web-services.xml file, however I
don't have any suggestions other that one that looks like you have
already tried, at the top, in the <schema...>
targetNamespace="urn:sap-com:document:sap:business"
Making edits to these generated files can be tricky and my only
suggestion is to create a small reproducer to run by our outstanding
support team.
A quick look at our problem database shows one issue (CR095109) related
to a similar problem at deploy time that was fixed with 7.0SP3. Again,
the support folks will be able to help focus in on the issue.
Regards,
Bruce
JD wrote:
>
The first posting contains the wrong web-services.xml file. Please refer to this
one instead.
"JD" <[email protected]> wrote:
I'm manually creating a web-services.xml file, and using the autogen
ant task to
generate the codec XML/Java classes. The XML definition is provided
by SAP.
The ant build.xml file:
<project name="buildWebservice" default="stubgen">
<target name="stubgen">
<clientgen ear="C:\projects\RMIS\ifrrequests\RMIS.ear"
packageName="com.aa.rmis.webservice.client"
clientJar="C:\projects\RMIS\ifrrequests\rmisws-client.jar"
autotype="False" />
</target>
<target name="all" depends="stubgen"/>
</project>
The problem is seen below in the output from Ant. Note the WARNINIG.
The problem
is that the xml type cannot be mapped to the Java type.
C:\projects\RMIS\ifrrequests>ant -buildfile clientbuild.xml
Buildfile: clientbuild.xml
stubgen:
[clientgen] Generating client jar for RMIS.ear ...
[clientgen] WARNINIG: Unable to find a javaType for the xmlType:['urn:sap-com:do
cument:sap:business']:PaymentRequest.Create. Make sure that you have
registered
this xml type in the type mapping
[clientgen] Using SOAPElement instead
[clientgen] Compiling 4 source files to C:\DOCUME~1\944377\LOCALS~1\Temp\rmisws-
client.jar-836624340
[clientgen] Building jar: C:\projects\RMIS\ifrrequests\rmisws-client.jar
BUILD SUCCESSFUL
Total time: 17 seconds
The Java source that has the implementation of the service methods is
simply:
package com.aa.rmis.webservice;
import com.aa.rmis.ifr.request.*;
public class TestService
public TestService()
public int serviceRequest(PaymentRequestCreate request)
System.out.println("Received serviceRequest message");
return 0;
public void testStringRequest(String request)
The web-service.xml file is attached, which contains the schema for the
SAP PaymentRequest.Create
object definition.
Another problem I have, which is probably related, is that the service
method
that has a complex data type (non-built in data type) is not being deployed
into
the WebLogic server. But the other service method that simply takes
a String
parameter is.
The steps I took are:
1. Get XML from SAP Interface Repository (IFR) for PaymentRequest
2. Use ant task autogen to generate the request codec classes
3. Create the web-services.xml file by inserting the schema definition
and the
mapping file created by the autogen task, and defining the operations
4. Build web-services.war file that contains all autogen compiled class
files,
the web-services.xml file, and the service implementation class
5. Build the ear file that holds the web service files
6. Use the clientgen ant task to generate (included above) to generate
the client
jar file that should contain the proxy for both of the service methods
Environment:
* WebLogic 7.02
* JDK 1.3.1_06
* JBuilder 9 Enterprise
* Ant 1.4
Possible causes:
* Namespace not being used correctly
* copied verbatim the mapping xml file generated by autogen into
the web-services.xml
file
* xml-schema part of web-services.xml might not be set correctly
* operation definition might not be using the correct namespace
* Classpath used for ant might not be right
* Doubt this is the problem, but I'm out of other ideas
* Set by using the setWLEnv.cmd file provided by WebLogic
* Tried adding the generated classes directory for my project to
the classpath,
but did not work
I've been referencing the Programming WebLogic Web Services document
throughout
this entire process. I must be missing something.
Can anybody from BEA help me out with this problem?
Thanks in advance.
Name: web-services.xml
web-services.xml Type: ACT Project (text/xml)
Encoding: base64
Maybe you are looking for
-
Hi Is there a way of moving the day and date text to the left or centre of the column in month view calendar? at the moment mine is on the right and can be a little confusing
-
Capture audio from soundcard - help!
Hi everyone, I'm tyring to write a little utility that captures everything coming out of my sound card and stores it as a .wav file on the system. (When I say everything, I mean wave output...for now). The purpose of this little exercise is two fold,
-
Oracle ADF Secured App Gives HTTP 401 Error
I am new to Oracle ADF Framework. I develop on JDeveloper 11g R2 with Weblogic 10.3.5.0. I developed an project like described in a Firebox training video on Youtube link: [http://bit.ly/HT1HZ9] . You can download my project from http://db.tt/Y8J3fj3
-
Sql query to find the space in between the sentense
hi, can anybody tell me the query to find the space in between the data chandan
-
Extend Customer to Different Company code?
Hi. How to extend Customer to Different Company code? ie, Cust1 is created with ABC company code, now i want to extend the same with XYZ company code. in same client. Reg, Antaa21