Database Accessor
I successfully connected to a local mysql database using the
Database Accessor. How do I access the data now? Where would be the
dataProvider info to use once the connection is setup?
Hi,
Please give me more information about what you did? have you
managed to press finish on the Database Accessor wizard? If yes,
have you managed to run the resulted code? It is working for you?
This wizard was created to show a quick sample on how to
access data from Flex using a server technology.
Regards,
Miti
Similar Messages
-
The database accessor wizard connects successfully to the
MySQL database and shows the table I created.
However, in the "Generate server-side code" step of the
wizard, I receive "The selected Project doesn't contain a valid
server nature!". My Flex project uses Live Cycle Data Services as
the server type. I have tested that Live Cycle DS is installed
correctly and functioning.
Is there any documentation on resolving the "The selected
Project doesn't contain a valid server nature!" error?
Thank youTry installing WTP onto your Eclipse implementation then
install something like JBoss. Also, install LiveCycle again but
choose the J2EE install.
Now run the Data Accessor again for a new project. This time,
you'll be able to select J2EE instead of LiveCycle... select JBOSS
as your app server and then you can choose LiveCycle as your data
communication method. You'll need to select 'flex.war' from your
LCDS J2EE directory along the way.
This should work.
And then you'll most likely find yourself in this situation:
http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=72&catid=651&threadid =1295102&enterthread=y
I posted that under an old ID by mistake but it's me - and
it's where I'm at right now... a little further along from you but
still hitting brick walls nonetheless! Really hoping there's going
to be a new beta out soon because this one is so broken in this
area - particularly with accessing Oracle - the wizard won't even
work on that at all which is why I'm messing with mySQL right now
instead.
Anyway, hope this helps.
Jamie. -
Hi,
Simple question, how do you delete a database accessor you
have created?
Thanks
TimHi,
After creating a database connection you can delete it from
Data Source Explorer panel by right clicking on it and choosing
Delete.
If you don't have the Data Source Explorer opened you can
open it from eclipse main menu Window->Show
View->Other->Connectivity->Data Source Explorer
Thanks,
-Catalin -
Pardon my ignorance. I've been playing w/the new Flex 3
Beta.... I'm very happy w/the most recent improvements
One thing that I really think adobe underestimated was the
Database Accessor wizard..... I can't find any docs, tutorials, or
napkin drawings to tell me in more details how cool and great it
is......... perhaps is my lack of flex hardcore experience.... but
how do other people connect to MySQL from a Tomcat server without
using Remoting, or the LiveCycle thing? I mean, can Flex output JSP
code as well as wut the wizard outputs PHP? or is there any other
magical way of doing this {The "on-a-budget(free)"} way without
buying the liveCycle thing, or going Remoting?
I'm trying to migrate an old Flash mx 2004 app that uses
OPENAMF onto Flex, unfortunately buying the livecycle thing is out
of the question, and as a bonus......OPENAMF doesn't support AMF3,
and apparently no one has updated their site since Colombus
discovery.... Sooo, my only choices are some sort of open source
solution......it needs to be simple and fast.
I know about webservices, and xml, etc. ......but I was just
trying to minimize the transitions by not having to re-write all of
our Java classes.Hi, have you seen our beta tutorial for the Data Wizard?
http://labs.adobe.com/wiki/index.php/Flex_3:Feature_Introductions#Introductory_Data_Wizard s
You absolutely can use the wizard to connect to MySQL on a
Tomcat server without LCDS. Just select the "XML over HTTP" option
in the wizard. (The "LCDS" tutorial shows this -- it picks the LCDS
option but it also shows the place where you can select XML over
HTTP instead.) The wizard will generate a Java servlet. It doesn't
generate JSP code, but that's not really applicable here since it
can generate the underlying servlet directly.
So, this means you'll be using a different way of encoding
the data over the wire (XML instead of AMF/remoting as your old app
did), but the wizard generates code for handling the
encoding/decoding of your application and server data into XML, so
it shouldn't make much difference to your app.
Hope that helps,.
Tom -
Read binary file information from servlet - from database accessor method
Okay, I have been working on this for awhile now and I just plain dont know what I am doing. Could someone please help me? I cannot find any examples through google or the forums for this specific type of situation( as in a servlet calls a method which gets binary file from a database).
- How do I get the inputStream into the servlet so that I can read it?
- Why am I getting the error message that OutputStream has already been called?
If someone could give me direction or simply tell me what I should look up - I would really really appreciate it.
The Servlet
response.setContentType("application/msword");
response.setHeader("Content-disposition","attachment; filename="+ file + ext);
OutputStream os = response.getOutputStream();
OOT openAttachments = searchInfo.openAttachments(newID, oot, ootNum, file, ext, os);
InputStream is2 = oot.getIs();
byte b[] = new byte[16384];
int numBytes;
while((numBytes=is2.read(b))!=-1){
os.write(b,0,numBytes);
System.out.println("is - in while" + is);
is2.close();
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/ootMain.jsp?newID="+newID);
dispatcher.forward(request, response);
os.flush();
os.close();
The Method
public OOT openAttachments(String newID, OOT oot, String ootNum, String file,
String ext, OutputStream os) {
this.conn = database.SybaseDAO.grabConnection();
String query = " edited for space'";
state = conn.createStatement();
rs = state.executeQuery(query);
if(rs.next()){
InputStream is = rs.getBinaryStream(2);
oot.setIs(is);
System.out.println("is - in while" + is);
is.close();
Error Messages
(is - in while - method) sun.jdbc.odbc.JdbcOdbcInputStream@c02a
(is2 - after - servlet) sun.jdbc.odbc.JdbcOdbcInputStream@c02a
IOException: java.io.IOException: InputStream is no longer valid - the Statement
has been closed, or the cursor has been moved
Mar 14, 2005 9:53:19 AM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException: getOutputStream() has already been called for this responseThanks for your help/time -
CrystalHere is the entire exception:
Mar 16, 2005 9:32:44 AM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException: getOutputStream() has already been called for this response
at org.apache.catalina.connector.Response.getWriter(Response.java:596)
at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:161)
at javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:111)
at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:122)
at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:115)
at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:182)
at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:115)
at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:75)
at org.apache.jsp.ootMain_jsp._jspService(org.apache.jsp.ootMain_jsp:596)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:302)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:246)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:682)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:581)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:501)
at oot.display_files.doGet(display_files.java:63)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:106)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:576)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Mar 16, 2005 9:32:44 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet display_files threw exception
java.lang.IllegalStateException: getOutputStream() has already been called for this response
at org.apache.catalina.connector.Response.getWriter(Response.java:596)
at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:161)
at javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:111)
at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:122)
at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:115)
at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:182)
at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:115)
at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:75)
at org.apache.jsp.ootMain_jsp._jspService(org.apache.jsp.ootMain_jsp:596)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:302)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:246)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:682)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:581)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:501)
at oot.display_files.doGet(display_files.java:63)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:106)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:576)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)Line 63 is the include... -
Missing Database Wizards in Beta 1
Has anyone found the Flex Builder 3 database wizards as
described by Matt Chotin in
http://www.adobe.com/devnet/flex/articles/flex3_whatsnew.html
Are they included in beta 1 or not ?
Do they run on Mac OS X or are they stupidly Windows only
(very lame in the not-buying-license way if that is the case)
Installing FB3 as plugin to Eclipse 3.2.2+WTP 1.5+DTP 0.9
gives a 'Create Database Accessor' toolbar item.
Clicking it gives
java.lang.NoClassDefFoundError:
org/eclipse/datatools/connectivity/internal/ConnectionProfileManager
in PDE Error Log view.
Which looks like something wrong with DTP install - which
wizards might be depending on ?
Ideas anyone ?I figured this out - it might have existed in Beta 1, but I would not have noticed. Here is what I think is the situation.
I only created Beta 1 apps using Excel spreadsheets. My image locations pointed to image feeds on the web and not locally, and took a few seconds too load before the app would display and there was a white intermediary screen after the splash, but before
the first page. I believe I posted a while back that this annoyed me.
I had an "ah HA" moment and created a new app from scratch with beta 2 that only used an Excel spreadsheet as a data source. SAME behavior, mostly. I did see the extended splash screen display (after I messed with the images and colors so that I could see
that there was an extended splash and when it displayed).
On a hunch, I added a REST data source that I am not currently using to the project and republished, installed app. produced for store. As I suspected from my ah HA moment, the Loading Animation showed up. Eureka.
1. I don't know if this is a bug and if the Loading animation should be available no matter what the data source is.
2. If it is by design, I'd like the option to include it - yes I will add to the requested features thread if someone from the Team confirms by design.
3. I didn't test to see what kinds of data sources = loading animation and which don't. If by design, is there a list of which do?
4. The work around for anyone looking to include the Loading animation who isn't seeing it MAY be to include a REST data source;
you do NOT have to use it, it only has to be added to the project.
-- Barb Bowman -
Error in User defined function for jdbc lookup
I am getting th error as follows "Method TestJDBCAPI$ with 2 arguments not found in class com.sap.xi.tf._JLU_MM_" when i a m testing in message mapping
//write your code here
String Query = " ";
Channel channel = null;
DataBaseAccessor accessor = null;
DataBaseResult resultSet = null;
//Build the Query String
Query = "Select role from login where username = " + username[0] + " and password = " + password[0] ;
try{
//Determine a channel as created in the configuration
channel = LookupService.getChannel("JLU_BUSS","JLU_chan");
// Get a system accessor for a channel.As the call is being made to the database an database accessor is obtained.
accessor = LookupService.getDataBaseAccessor(channel);
// Execute the Query and get the values in the resultSet.
resultSet = accessor.execute(Query);
for(Iterator rows = resultSet.getRows();rows.hasNext();)
Map rowMap = (Map)rows.next();
result.addValue((String)rowMap.get("role"));
catch(Exception ex){
result.addValue(ex.getMessage());
Above is my udf.My logic is that for the given username and password it should select the corresponding role from the database. -
Error while testing in message mapping for JDBC lookup
The error is as follows.
Exception during processing the payload.Problem when calling an adapter by using communication channel JLU_chan (Party: , Service: JLU_BUSS, Object ID: 0519f96e59c534829ebdcdea837dacb7) XI AF API call failed. Module exception: (No information available). Cause Exception: 'Error processing request in sax parser: Error when executing statement for table/stored proc. 'table' (structure 'statement'): java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Missing ), ], or Item in query expression 'username = [Ljava.lang.String;@d7f610 and password = [Ljava.lang.String;@5b96eb'.'.
com.sap.aii.mapping.lookup.LookupException: Problem when calling an adapter by using communication channel JLU_chan (Party: , Service: JLU_BUSS, Object ID: 0519f96e59c534829ebdcdea837dacb7) XI AF API call failed. Module exception: (No information available). Cause Exception: 'Error processing request in sax parser: Error when executing statement for table/stored proc. 'table' (structure 'statement'): java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Missing ), ], or Item in query expression 'username = [Ljava.lang.String;@d7f610 and password = [Ljava.lang.String;@5b96eb'.'.
at com.sap.aii.ibrun.server.lookup.AdapterProxyLocal.execute(AdapterProxyLocal.java:131)
at com.sap.aii.ibrun.server.lookup.SystemAccessorInternal.execute(SystemAccessorInternal.java:68)
at com.sap.aii.ibrun.server.lookup.SystemAccessorHmiServer.process(SystemAccessorHmiServer.java:149)
at com.sap.aii.ibrun.server.lookup.SystemAccessorHmiServer.process(SystemAccessorHmiServer.java:77)
at com.sap.aii.utilxi.hmis.server.HmisServiceImpl.invokeMethod(HmisServiceImpl.java:169)
at com.sap.aii.utilxi.hmis.server.HmisServer.process(HmisServer.java:178)
at com.sap.aii.utilxi.hmis.web.HmisServletImpl.processRequestByHmiServer(HmisServletImpl.java:296)
at com.sap.aii.utilxi.hmis.web.HmisServletImpl.processRequestByHmiServer(HmisServletImpl.java:211)
at com.sap.aii.utilxi.hmis.web.workers.HmisInternalClient.doWork(HmisInternalClient.java:70)
at com.sap.aii.utilxi.hmis.web.HmisServletImpl.doWork(HmisServletImpl.java:496)
at com.sap.aii.utilxi.hmis.web.HmisServletImpl.doPost(HmisServletImpl.java:634)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:160)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Root Cause:
com.sap.aii.af.service.api.AFException: XI AF API call failed. Module exception: (No information available). Cause Exception: 'Error processing request in sax parser: Error when executing statement for table/stored proc. 'table' (structure 'statement'): java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Missing ), ], or Item in query expression 'username = [Ljava.lang.String;@d7f610 and password = [Ljava.lang.String;@5b96eb'.'.
at com.sap.aii.af.service.api.AdapterAccess.sendMsg(AdapterAccess.java:214)
at com.sap.aii.af.service.api.AdapterAccess.execute(AdapterAccess.java:283)
at com.sap.aii.ibrun.server.lookup.AdapterProxyLocal.execute(AdapterProxyLocal.java:123)
at com.sap.aii.ibrun.server.lookup.SystemAccessorInternal.execute(SystemAccessorInternal.java:68)
at com.sap.aii.ibrun.server.lookup.SystemAccessorHmiServer.process(SystemAccessorHmiServer.java:149)
at com.sap.aii.ibrun.server.lookup.SystemAccessorHmiServer.process(SystemAccessorHmiServer.java:77)
at com.sap.aii.utilxi.hmis.server.HmisServiceImpl.invokeMethod(HmisServiceImpl.java:169)
at com.sap.aii.utilxi.hmis.server.HmisServer.process(HmisServer.java:178)
at com.sap.aii.utilxi.hmis.web.HmisServletImpl.processRequestByHmiServer(HmisServletImpl.java:296)
at com.sap.aii.utilxi.hmis.web.HmisServletImpl.processRequestByHmiServer(HmisServletImpl.java:211)
at com.sap.aii.utilxi.hmis.web.workers.HmisInternalClient.doWork(HmisInternalClient.java:70)
at com.sap.aii.utilxi.hmis.web.HmisServletImpl.doWork(HmisServletImpl.java:496)
at com.sap.aii.utilxi.hmis.web.HmisServletImpl.doPost(HmisServletImpl.java:634)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:160)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)I'll give you the query.Can you please check my code.Code is as follows.
//write your code here
String Query = " ";
Channel channel = null;
DataBaseAccessor accessor = null;
DataBaseResult resultSet = null;
//Build the Query String
Query = "Select role from login where username = " + username + " and password = " + password + "" ;
try{
//Determine a channel as created in the configuration
channel = LookupService.getChannel("JLU_BUSS","JLU_chan");
// Get a system accessor for a channel.As the call is being made to the database an database accessor is obtained.
accessor = LookupService.getDataBaseAccessor(channel);
// Execute the Query and get the values in the resultSet.
resultSet = accessor.execute(Query);
for(Iterator rows = resultSet.getRows();rows.hasNext();)
Map rowMap = (Map)rows.next();
result.addValue((String)rowMap.get("role"));
catch(Exception ex){
result.addValue(ex.getMessage());
finally{
try{
if (accessor!=null) accessor.close();
catch(Exception e){
result.addValue(e.getMessage()); -
Problem JDBC lookup PI 7.1
Hello everybody,
I have a scenario where the PI interface that were 7, were migrated to the PI 7.1 SP 05.
With this, we are having problems in PI 7.1, JDBC Lookup.
If I use the JDBC Lookup that exists in PI 7.1, it works.
Plus the problem, I have many interfaces, which were made by the JDBC Lookup IP 7, and error is happening in the IP 7.1, the error is
Error when calling an adapter by using the communication channel CC_EAI_JDBC_CADASTRO_Receiver (Party: , Service: BS_MSSQL_DEV, Object ID: 574a4888bf11379d99fa7359026ddb7c) The channel with object ID 574a4888bf11379d99fa7359026ddb7c could not be found in the Integration Server Java Cache. Check if the channel exists in the Integration Builder Directory and execute a refresh of the Java Cache.
The error happens in the line of code Featured:
/ / Set channel According to config Directory
channel = LookupService.getChannel (BS_MSSQL_DEV "," CC_EAI_JDBC_CADASTRO_Receiver ");
/ / Set database accessor
accessor = LookupService.getDataBaseAccessor (channel);
Its in PI 7.1, still be done this type of JDBC Lookup??
How can I solve this problem??
Thanks,
MarlonHello,
Stefan and Guru, had not noticed the '*' in the Party's CC.
I created another CC without the '*', and it worked.
Thank you all for your help.
Marlon
Edited by: Marlon Sperandio Monteiro on Sep 15, 2010 3:54 PM
Edited by: Marlon Sperandio Monteiro on Sep 15, 2010 3:54 PM -
Returning Mutliple Records using a function
I followed the instructions as per askTom at http://asktom.oracle.com/~tkyte/ResultSets/index.html
Created the package and created a fuction and it works if I do something like
select find_dba_licenses('ALBERTSON') from dual;
Now, the problem is that I want to use the function in the where clause and it's giving me an error.
ERROR at line 1:
ORA-00932: inconsistent datatypes: expected - got CURSER
Does anyone knows what it means?
If I try casting like below I get the same error
select license_id from t_license where license_id = (select cast(oda.find_dba_licenses('ALBERTSON') as number) from dual);
ERROR at line 1:
ORA-00932: inconsistent datatypes: expected NUMBER got CURSER
Thanks
anyhelp will be appreciated.
JuanI thought that using a function will be the easyest Wrong. The easiest is definitely a sub-query:
SELECT * FROM licences
WHERE licence_id IN
( SELECT licence_id FROM table_1
WHERE trading_name = 'ALBERTSON'
UNION ALL
SELECT licence_id FROM table_2
WHERE business_name = 'ALBERTSON')The above is a template, which you will need to tweak to fit your needs.
If you really want to do that in a function you could consider using a PIPELINED function that returns an array of licence IDs and use a TABLE() function on that. But I wouldn't recommend it unless you have additional processing which cannot be done in a SELECT statement.
What does it mean "between program units"?Between two discrete program, er , units. The canonical example is a database accessor for a web application. A Java bean (or whatever) passes parameters to a stored procedure (function) which executes a query and returns a resultset in the form of a ref cursor. Of course the program units can be two PL/SQL procedures but I think that is less common.
Cheers, APC -
How to design using J2EE pattern?
I am new to J2EE and I would like some ideas on how I should design the following system in J2EE pattern. I am required to use JSP pages + EJB to implement a very simple online shopping system. And I already created the following classes:
This is the EJB object interface.
package assignment;
import java.rmi.*;
import javax.ejb.*;
import java.util.Vector;
public interface ShoppingSystem extends EJBObject {
public boolean LoginAsCust(String id,String pwd) throws RemoteException;
public boolean LoginAsAdmin(String id,String pwd) throws RemoteException;
public Vector getMusicCategories() throws RemoteException;
public Vector getCategoryItems(String category) throws RemoteException;
public MusicRecording getMusicRecording(String id) throws RemoteException;
}This is the home interface.
package assignment;
import java.rmi.*;
import javax.ejb.*;
public interface ShoppingSystemHome extends EJBHome {
public ShoppingSystemHome create() throws RemoteException, CreateException;
}This is the session bean objects.
package assignment;
import java.rmi.*;
import javax.ejb.*;
import java.util.Vector;
public class ShoppingSystemBean implements SessionBean {
// data item to hold a reference to a passed Session context
private SessionContext ctx;
// save the session context
public void setSessionContext(SessionContext x) { ctx = x;}
// the various method implementations
// imposed on us by interface
public void ejbCreate() {}
public void ejbActivate() {}
public void ejbPassivate() {}
public void ejbRemove() {}
public boolean LoginAsCust(String id,String pwd) throws RemoteException{
public boolean LoginAsAdmin(String id,String pwd) throws RemoteException{
public Vector getMusicCategories() throws RemoteException{
public Vector getCategoryItems(String category) throws RemoteException{
public MusicRecording getMusicRecording(String id) throws RemoteException{
}I will probably need to create a shopping cart class and a database accessor class. What I would like to know is , do I need to divide the shopping cart class into three components: Home interface, EJB object interface, SessionBean object.
Please give me some ideas on how I can develop this system using EJB. (This is just a school assignment)
Thanks.know is , do I need to divide the shopping cart class
into three components: Home interface, EJB object
interface, SessionBean object.Shopping cart is a typical example of a stateful session bean. So you need to write a session bean. And, of course, every session bean consists of three things: remote interface, home interface and bean class.
Please give me some ideas on how I can develop this
system using EJB. (This is just a school assignment)In this case you can tell them to fuk off. -
Hey guys;
Just got the FLEX3 and want to connect to SQL2k5, looks like
it always fails to connect to my database.
Any specific steps i need to do using the database Accessor?
thanks;
MikeHi Mike,
Flex Builder connects to SQL Server through a TCP/IP
connection. This type of connection it might not be enabled for
your server. Please check if this is the case for you (the default
port is 1433).
Regards,
Miti -
A jsp page for searching employees
this jsp page is used for searching employees and displaying the search results.
when the submit button is clicked, the http request will be sent to a servlet java class.
<%@ page contentType="text/html" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<html>
<head>
<title>SEARCH STAFF</title>
</head>
<body>
<p align="center"><font color="#008000">SEARCH STAFF</font></p>
<FORM METHOD=POST ACTION="/servlet/ReqHandler?action=searchstaffget">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td width="50%">Staff ID:</td>
<td width="50%"><INPUT NAME=staffid SIZE=15></td>
</tr>
<tr>
<td width="50%">First Name:</td>
<td width="50%"><INPUT NAME=firstname SIZE=30></td>
</tr>
<tr>
<td width="50%">Last Name:</td>
<td width="50%"><INPUT NAME=lastname SIZE=30></td>
</tr>
<tr>
<td width="50%">Gender:</td>
<td width="50%"><select size="1" name="sex">
<option value="m" selected>Male</option>
<option value="f">Female</option>
</select></td>
</tr>
<tr>
<td width="50%">E-mail:</td>
<td width="50%"><INPUT NAME=email SIZE=30></td>
</tr>
<tr>
<td width="50%">Birth date:</td>
<td width="50%"><INPUT NAME=birthdate SIZE=10></td>
</tr>
<tr>
<td width="50%">Address:</td>
<td width="50%"><input type="text" name="addr" size="30"></td>
</tr>
<tr>
<td width="50%">Phone number (Home):</td>
<td width="50%">
<input type="text" name="phoneno" size="8"></td>
</tr>
<tr>
<td width="50%">Phone number (Mobile):</td>
<td width="50%">
<input type="text" name="mobileno" size="8"></td>
</tr>
<tr>
<td width="50%">ID card number:</td>
<td width="50%"><input type="text" name="idno" size="8"></td>
</tr>
<tr>
<td width="50%">Position:</td>
<td width="50%"><select size="1" name="position">
<option value="deliveryman" selected>Deliveryman</option>
<option value="normalstf">Normal Staff</option>
</select></td>
</tr>
</table>
<P align="center">
<INPUT TYPE=SUBMIT></FORM>
<!--
I WANT THE SEARCH RESULTS TO BE DISPLAYED HERE IN THIS JSP PAGE.
THIS MEANS THAT, AFTER THE SUBMIT BUTTON IS CLICKED, THE FORM ABOVE WILL NOT DISAPPEAR AND THE SEARCH RESULTS WILL DISPLAY BELOW THE FORM.
--> the java servlet class will then forward the search parameters(last name, first name....etc.) to a database accessor class and this class will then return an arraylist of all the columns for each row in the database that match the search criteria. Each column of a row is stored as a String object in the arraylist.
what i would like to ask is, what codes should i use in the servlet class, and what codes should i use in the jsp page, in order that, the search results will finally display in <TABLE> format.
please help, thanks a lot~~~~~~~~put the search results in session in your servlet
using
request.getSession().setAttribute("SEARCH_RESULT_SESSI
ON", searchResult);
where searchResult is your arrayList.
in your JSP page:
<c:set var="SEARCH_RESULT"
value="<%=SEARCH_RESULT_SESSION%>"/>
<c:set var="searchResult"
value="${sessionScope.SEARCH_RESULT}"
scope="request"/>
and use this searchResult to display your results in
whatever format you want.
<c:forEach var="result" items="searchResult">
<c:out value="${result}"/>
result is the string that you stored in arrayList.
</c:forEach>
Questions, let me know.thanks but.....
this doesn't work for me, i placed this statement in my java servlet class:
request.getSession().setAttribute("SEARCH_RESULT_SESSION", searchResult);and i placed the other statements in the JSP page like this:
<%@ page contentType="text/html" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ page isELIgnored="false" %>
<%@ page import="java.util.ArrayList" %>
<html>
<head>
<title>SEARCH STAFF</title>
</head>
<body>
<p align="center"><font color="#008000">SEARCH STAFF</font></p>
<FORM METHOD=POST ACTION="/servlet/ReqHandler?action=searchstaffget">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td width="50%">Staff ID:</td>
<td width="50%"><INPUT NAME=staffid SIZE=15></td>
</tr>
<tr>
<td width="50%">First Name:</td>
<td width="50%"><INPUT NAME=firstname SIZE=30></td>
</tr>
<tr>
<td width="50%">Last Name:</td>
<td width="50%"><INPUT NAME=lastname SIZE=30></td>
</tr>
<tr>
<td width="50%">Gender:</td>
<td width="50%"><select size="1" name="sex">
<option value="m" selected>Male</option>
<option value="f">Female</option>
</select></td>
</tr>
<tr>
<td width="50%">E-mail:</td>
<td width="50%"><INPUT NAME=email SIZE=30></td>
</tr>
<tr>
<td width="50%">Birth date:</td>
<td width="50%"><INPUT NAME=birthdate SIZE=10></td>
</tr>
<tr>
<td width="50%">Address:</td>
<td width="50%"><input type="text" name="addr" size="30"></td>
</tr>
<tr>
<td width="50%">Phone number (Home):</td>
<td width="50%">
<input type="text" name="phoneno" size="8"></td>
</tr>
<tr>
<td width="50%">Phone number (Mobile):</td>
<td width="50%">
<input type="text" name="mobileno" size="8"></td>
</tr>
<tr>
<td width="50%">ID card number:</td>
<td width="50%"><input type="text" name="idno" size="8"></td>
</tr>
<tr>
<td width="50%">Position:</td>
<td width="50%"><select size="1" name="position">
<option value="deliveryman" selected>Deliveryman</option>
<option value="normalstf">Normal Staff</option>
</select></td>
</tr>
</table>
<P align="center">
<INPUT TYPE=SUBMIT></FORM>
<c:set var="SEARCH_RESULT" value="<%=SEARCH_RESULT_SESSION%>"/>
<c:set var="searchResults" value="${sessionScope.SEARCH_RESULT}" scope="request"/>
<c:forEach begin="1" end="3" var="result" items="searchResults">
<c:out value="${result}"/>
</c:forEach>
</body>
</html>
i typed some data in the text fields and clicked "submit" button
but it turned into a blank page
i was sure the arraylist contained the search results because i tried to write them into the stdout.log file.
could you please tell me why it's like this? -
Jdbc thin classes111.zip and timeout
Is it possible that there is a timeout on a connection to a
database?
I use oracle 8, IBM Websphere app server on NT IIS4.0 Service
pack 5.0 and TOPLink 2.0
the database accessor get disconnected after a 2nd user access
the database.
thank you all
laurence
nullLaurence courdier (guest) wrote:
: Is it possible that there is a timeout on a connection to a
: database?
: I use oracle 8, IBM Websphere app server on NT IIS4.0 Service
: pack 5.0 and TOPLink 2.0
: the database accessor get disconnected after a 2nd user access
: the database.
It looks like there're subtle differences between how
connections from native OCI stuff and JDBC type 4 (native java)
driver appear to Oracle session manager. In our case, after
certain period of user (java app) inactivity, any subsequent
attempt to do smth. causes SQLException "Connection closes by
peer" to be thrown inside Oracle JDBC classes. So it looks like
you have to do some sort of "ping" against a database periodicly
(I guess every our or so) so that DB is sure your side is alive.
I suspect that native OCI library silently does smth. similar.
Hope that helps,
Ernest
null -
Calling a Stored Procedure From Database Using XI.
Hi,
Please help in writing a UDF for these fields in mapping, which I need for the object Iu2019m doing currently.
The fields are like this:
1) batch_no = "TRUNC((GetMaxObjid('x_txn_sap_parts')-POWER(2,28))/5000)+1",
2) lot_id = "TRUNC((GetMaxObjid('x_txn_sap_parts')-POWER(2,28))/500)+1",
3) How to use JDBC connection factory class in the UDF.
Some logic I can provide which I know i.e. Power (2, 28) means 2 to the power of 28 (2 multiplied 28 times), Trunc means truncate, X_TXN_SAP_Parts is a database table.The Target fields are Batch_no, lot_id & Objid.Actually, objid is mapped initially to a source field i.e. Object ID and in this function it is only being used for the calculation of the batch_no.
I've tried to use this code but still I'm unable to execute the mapping.
import java.util.*;
import com.sap.aii.mapping.lookup.*;
import com.sap.aii.mapping.lookup.*;
DataBaseAccessor accessor = null;
DataBaseResult JDBCOutPayload = null;
String BusinessSystem="clarify_dev_bizsys";
//give your business system having channel name
String CommunicationChannel="JDBC_TO_CDEV";
//give your channel name
String InputPayload= " select X_TXN_PRE_SITE_XFACE.nextval from dual;";
//give your sql query
try {
Channel channel =
LookupService.getChannel(BusinessSystem,CommunicationChannel);
accessor = LookupService.getDataBaseAccessor(channel);
DataBaseResult resultSet = accessor.execute(InputPayload);
for(Iterator rows = resultSet.getRows();rows.hasNext();){
Map rowMap = (Map)rows.next();
Object cValue = rowMap.get("batchno");
//field name of field required , as in database
catch (Exception e) {}
finally {
if (accessor != null)
accessor.close();
result.addValue((String)cValue);
--> I don't know what are the parameters to be used and how to be used in the UDF because this is the first time I'm writing a UDF.
--> The problem in using this query is that both OBJID & BatchNo. are on the target side and the value for the OBJID is retrieved by a SELECT query from the database.
Kindly help me how to resolve this query of mine.
Thanks in Advance.
Sreedhar.Hi,
The scenario is like I've to get a field (OBJID) value after using a SELECT statement from the database and use the same value for calculating another field values which is BATCHNO & LOTID.
OBJID, BATCHNO and LOTID are from the same database.
Thats all I was provided as the input.
Do let me know if you need anymore information. I'll try to give as much input to the extent I know.
Sreedhar.
Maybe you are looking for
-
SAP Workflow not triggering due to "Start Condition return FALSE" message in SWEL
Hi, I have SES approval workflow which is not triggering in few cases because of check function ends with exception even it has valid start condition and correct data. For example lets say we have PO no. 100 for which 3 SES (SES1,SES2 & SES3) are cre
-
Changes are not reflecting in instance
Hi All, I have done CO extension. When i applied through personalization the changes is reflecting and when i removed the CO extension also it is showing the same. Can you please tell me why it is behaving like this? Regards, Murali Edited by: user12
-
I'm using PL/SQL to render a whole host of content in HTML via Oracle Portal. What I'd like to do is display a piece of HTML if the current user is within groups X, Y or Z. So in layman's terms: IF user_group = SLCPortalDeveloper then htp.p('<p>this
-
hi, there. I am working Oracle Spatial 9.0.1 and I have a problem about the performance of spaital query, can someone help me resolve it? /*query 1*/ select t1.line_seg from spatial_list_Traj where sdo_within_distance(convert_trajseg_to_lineseg (t1.l
-
Have Aperture Trial Version...Want to purchase...
Per the title, I have the 30-day trial version on my iMac... I like it! I've not purchased anything from the App Store for my Mac, so here's the question: With the trial version on my computer, when I purchase the "full" verson of Aperture, will I b