How to retrive data from oracle dtaabase to JSP
HI Please help me in the fallowing issue,
I am writing 2 JSps with tomcat 5.5 while I am retiving data from database ,, I am unable to retive it.
can any one help what is the best solution,
Thanks IN Advance,,
here is my code..
<%@ page language="Java" import="java.sql.*"%>
<%
try
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@Spandhan:1521:orcl",
"waveset" ,"waveset");
Statement stmt = conn.createStatement ();
ResultSet rset = stmt.executeQuery ("select * from "+request.getParameter('tableName'));
while (rset.next ()){
out.println(rset.getString (1));
//out.println("4");
BLOB b=rset.getBLOB ("XML");
//out.println("5");
out.println(b.getBytes(1,b.length()));
//out.println("6");
out.println("<BR/>");
out.println("<BR/>");
}catch(Exception e){
out.println(e);
%>
My error is this ,,
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 3 in the jsp file: /test.jsp
Generated servlet error:
Invalid character constant
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 3 in the jsp file: /test.jsp
Generated servlet error:
Invalid character constant
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:414)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.
Apache Tomcat/5.5.20
Thanks all. i did modification to the code, now i am getting onother error that
javax.servlet.ServletException: Invalid column type: getBLOB not implemented for class oracle.jdbc.driver.T4CVarcharAccessor
i want to retrive BLOB value from database ,,
here is my modification code ,,
and i am using jar OJDBC14.jar . the path is correct,I dont know whether this driver will support to retrive Blob value or not ?
<%@ page language="Java" import="java.sql.*" %>
<%
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@hostname:1521:orcl","waveset","waveset");
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery ("select * from USEROBJ");
while (rset.next()){
long l=1L;
Blob b=rset.getBlob(1);
int len=(int)b.length();
String s=new String(b.getBytes(l,len));
out.println(s);
out.flush();
%>
My error is like that ...
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Invalid column type: getBLOB not implemented for class oracle.jdbc.driver.T4CVarcharAccessor
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
javax.servlet.ServletException: Invalid column type: getBLOB not implemented for class oracle.jdbc.driver.T4CVarcharAccessor
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:843)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:776)
org.apache.jsp.test4_jsp._jspService(test4_jsp.java:74)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.sql.SQLException: Invalid column type: getBLOB not implemented for class oracle.jdbc.driver.T4CVarcharAccessor
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
oracle.jdbc.driver.Accessor.unimpl(Accessor.java:358)
oracle.jdbc.driver.Accessor.getBLOB(Accessor.java:1300)
oracle.jdbc.driver.OracleResultSetImpl.getBLOB(OracleResultSetImpl.java:1275)
oracle.jdbc.driver.OracleResultSetImpl.getBlob(OracleResultSetImpl.java:1461)
org.apache.jsp.test4_jsp._jspService(test4_jsp.java:55)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.
Apache Tomcat/5.5.20
Please help me, Thanks,
----------------------------------------------------
Similar Messages
-
How to extract data from oracle database directly in to bi7.0 (net weaver)
how to extract data from oracle database directly in to bi7.0 (net weaver)? is it something do with EDI? can anybody explain me in detail?
Thanks
YorkYou can use UDConnect to get from Oracle database in to BW
<b>Data Transfer with UD Connect -</b>
http://help.sap.com/saphelp_nw04/helpdata/en/78/ef1441a509064abee6ffd6f38278fd/content.htm
<b>Prerequisites</b>
You have installed the SAP WAS J2EE Engine with BI Java components. You can find more information on this in the SAP BW installation guide on the SAP Service Marketplace at service.sap.com/instguides.
Hope it Helps
Chetan
@CP.. -
HOW to retrive data from SAP Tabel
Hi Friends,
1)Can you please explain how to retrive data from SAP table(example AFRU).
2) we had requriment based on the qunatity , Product name and date we need to display KPI's .KPI is based no products manfactured per day with some conditions
Regards
SrikanthHi Udayan,
I want to retrive SAP Table data from xMII.can you please explain elabarately how to call "RFC_READ_TABLE" from xMII.
please do the needful
Thanks
Srikanth -
How to pull data from oracle GL to planning
Hi all
Can one suggest me how to pull data from oracle GL in to hyperion planning(we are using hyperion planning 9.3 with limited licence for analytic services). i guess we can use HAL ..any thing else
any help is appreciable
regards
M.VHi
I appreciate for your response. Yep you are exactly right it is data only, but I do have a problem these people have their licence of limited version of Essbase.
Let me give you the information of their licence agreement.
The licence for the hyperion planning- sytem9 programs includes a limited use license for both the hyperion Essbase- system 9 and hyperion Financial reporting - system 9 programs. Such limited use license means that the hyperion Essbase- system 9 and Hyperion financial reporting -system 9 programs may only be used to access data from the Hyperion planning -system 9 program.
Specifically, the hyperion essbase- system 9 program cannot be used to create Essbase cubes that do not contain data used by the Hyperion planning- system 9 program and the Aggregate storage option component of the Hyperion Essbase - system 9 program may not be used.
1) what it(licence agreement) really means - can you install Essbase, if not how can you create dimensions dynamically using planning.
2) Is it possible without Essbase as far as I know its not possible
3) are we going to face any issues with this licence.
4) Is it possibe to pull data with planning
I appreciate if any one resolve this issue
regards
M.V -
How to Extract data from Oracle DB to BW via DBConncet interface.
HI All,
Do you know how to extract data from ORACLE data base to BW, using DBConnect.
Here we are not using R/3 Business content structures.
How to do it in both source system and BW side?
How to define structures on both sides.
Please provide any documents on that.
Thanks in Advance.
Sri.Hi Srilaxmi
Have a look at these links
http://help.sap.com/saphelp_nw04/helpdata/en/58/54f9c1562d104c9465dabd816f3f24/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/a1/89786c3df35c4ea930a994e884bb4c/content.htm
http://help.sap.com/saphelp_bw30b/helpdata/en/80/1a618ae07211d2acb80000e829fbfe/content.htm
and this thread
Extract from Oracle View with DB connect
regards
KR -
How to retrive data from selected checkboxes with fieldnames
hi experts,
how to retrive data from selected checkboxes with fieldnames into another alv grid report.(here the fieldnames selected from table names is dynamically).
thankx in advance
rani.k.Hi,
Use user_command in the alv grid and then
do the follwoing code
FORM user_command1 USING lv_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
Declaration of local Variables
DATA : lv_ref1 TYPE REF TO cl_gui_alv_grid.
DATA lv_cnt TYPE i. "+INS SUHESH 12.07.2008
Check function code
CASE lv_ucomm.
WHEN 'ONLI'.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = lv_ref1.
CALL METHOD lv_ref1->check_changed_data.
now loop ur final internal table where check = 'X'.
now pass data to other internal table..Now the internal table will be having values that the user selcetd on the screen.
Hope this helps.
Regards,
Nagaraj -
How to retrive data from database views or projection views
how to retrive data from database views or projection views
Hi chintam,
1. Very simple
2. Just like normal select statement.
3. Select * from VIEWNAME.
4. (Instead of the tablename, we just have to give the viewname)
regards,
amit m. -
How to retrive data from this inernal table
hi,
could u please explain clearly how to retrive the records from this structure
data: begin of itab.
include structure sflite.
data:end of itab.
how to retrive data from this structure could u plz give me a code with example.Hi,
TYPES: BEGIN OF struc1,
val1 TYPE c,
val2 TYPE c,
END OF struc1,
BEGIN OF struc2,
val type struc1,
val3 TYPE c,
val4 TYPE c,
END OF struc2.
DATA: l_f_str1 type struc1,
l_f_str2 type struc2.
START-OF-SELECTION.
l_f_str2-val-val2 = 'a'.
write : / l_f_str2-val-val2.
END-OF-SELECTION. -
How to migrate data from oracle 9i database to new machine 11gr2 RAC ASM
Hi Expert
I need your expertise to advise me what is the best method to move data from oracle 9i database to new machine running oracle 11r2 RAC database with ASM.
Currently my production server running on HPUX ORACLE 9I database with normal file system. My new server is running SUN SOLARIS SPACR 64 bit ORACLE 11gr2 RAC with ASM. What is best method to move data over so it will be consistent. Any guide can refer.
Regard
WilliamHi William,
See the note in metalink Migration of Oracle Database Instances Across OS Platforms [ID 733205.1] to saw the Endian Format of your OS. If is the same you can use the RMAN to convert the database to another OS, if not the only option is using export/import (Transportable Tablespaces).
To upgrade from 9i to 11g, see the note 837570.1 - Complete Checklist for Manual Upgrades to 11gR2.
To migrate your FS to ASM the only way is using RMAN, so see the note - How to move a datafile from a file system to ASM [ID 390274.1].
Hope this help you.
Best Regards,
Ruben Morais -
How to Display Data from Oracle E Business Suite tables in ADF
Hi,
I am new to ADF.
I have a requirement to Create an ADF page for Search Results Screen.
However the result data is from one of the Oracle E Business Suite Tables.
ie I need to create a Screen where user will enter a Purchase Order Number and Click on Button.
The Screen should show details from PO_HEADERS_ALL (from Oracle ERP Database Table) based on the entered PO Number.
Is it possible to implement the same? Can some one guide me how to do it?
Thanks,
KamathHi,
Is there a way where I can create a VO in ADF to which I can insert records dynamically from a source and the Source connects to E Business Suite tables and returns results ie BPEL etc.
http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/bcadvvo.htm#sm0341
Just replace the PLSQL example with your data source
Can ADF invoke SOA which inturn connects to Oracle E Business Suite and fetches the data from Oracle tables and pass it back to ADF? Is it possible
Yes. Just use a WS proxy client to access the SOA entry point (WSDL) and follow the link above
Frank -
How to retrive data from SAP Archive (from Cluster or Content Table)
Hi,
I am working on HR -ABAP where i have a scenario to retive employee photo and disaplay as output in smartforms.And these employee photo are stored in Cluster table SDOKCONT1 in SAP Archive Link (storage type - SAP System Database).
Anybody can tell me the way how to retrive data ( employee Photo ) from this cluster and display its output in smartform dynamically.
Regards,
Sourabh ShrivastavaHello Sourabh,
If I am not wrong, there are two parts two your query...
a) Data or Content Retrieval
b) Displaying Retrieved content
Here is my feedback
a) The Content can be Retrieved using the FM ARCHIV_GET_TABLE.
Pass the Archive Object, SAP Object and the SAP Object ID and based on the Connection table entries (TOA*), the underlying Content Repository (T-code OAC0) is determined and a request for synchronous retrieval is made to the Content Server.
b) Display of Retrieved content is normally done through dedicated viewers (Ex: Livelink Viewer) or front-end applications (Excel, Word) based on the Protocol (OAA3/OAA4) specified in the Content Reository Configuration. Hence, to my knowledge, you cannot display the content directly in the Smartform.
With Regards
Vijay Gajavalli -
How to bring data from Oracle based Non SAP System to SAP
Dear Friends,
I have two servers, one is SAP and the other one is Non SAP with Oracle in backend. Please suggest how to take data from the NonSAP server to SAP server or how to connect the two.
Please send the step-by-step configuration if possible.
Thanks in advance,
Alok.Hi
Step 1: Create an entry for the External database in DBCON table using Trxn: DBCA.
Table: DBCON (Description of Database Connections)
Field Name Description Value (For: E.g.:)
CON_NAME Logical name for a database connection RAJ
DBMS Database system MSS
USER_NAME Database user <username>
PASSWORD Password for setting up the connection <pwd>/<pwd>
CON_ENV Database-specific information MSSQL_SERVER=depotserver MSSQL_DBNAME=HOF_INDORE
DB_RECO
Step 2: Now you can write code to connect to the external database
Your Sample code can be something like this
FUNCTION-POOL z_houston. "MESSAGE-ID ..
DATA: BEGIN OF wa,
c_locid(3),
c_locname(50),
c_locstate(5),
END OF wa.
FUNCTION z_houston_connect.
""Local interface:
EXEC SQL.
CONNECT TO 'RAJ' AS 'V'
ENDEXEC.
EXEC SQL.
SET CONNECTION 'V'
ENDEXEC.
*- Get the data from MS-SQL Server
EXEC SQL.
open C1 for
select
loc_id,
loc_name,
loc_state
from ho_loc_mast
ENDEXEC.
DO.
EXEC SQL.
FETCH NEXT C1 into :wa-c_locid, :wa-c_locname, :wa-c_locstate
ENDEXEC.
IF sy-subrc = 0.
PERFORM loop_output.
ELSE.
EXIT.
ENDIF.
ENDDO.
EXEC SQL.
CLOSE C1
ENDEXEC.
ENDFUNCTION.
*& Form LOOP_OUTPUT
Output
FORM loop_output .
WRITE: /5 wa-c_locid, 10 wa-c_locname, 65 wa-c_locstate.
CLEAR wa.
ENDFORM. " LOOP_OUTPUT
Regards
Raj -
Confused How to push Data from Oracle DB Tables into Hyperion Planning?
HI
I m Newbie to ODI. My DataSource is Oracle 11g Database (HR Tables) and my Target is Hyperion Planning.
I successful imported Oracle DB HR tables into ODI and Hyperion Planning Dimensions Like(Employee) but i dont understand in " ODI Interface" how i am going to do Mapping between Oracle tables and Planning application Dimension, am i doing wrong way?
I am confused if i have to push Data from Oracle 10g HR Tables into Hyperion Planning am i following right approach ?
Looking for your guideline...
Regards
SherHi John
Well i have working knowledge in ODI, i did whole complete cycle and i did customization project for Oracle EBS to Data warehouse though ODI.
What, I am NOT able to figure out How to LINK Hyperion Planning Outline to Oracle EBS HR Tables. cause in Hyperion Outline i m able to view Dimensions Not particular Column to map with EBS HR Table (column).
Eample:
In EBS HR we have Employee Number in Per_all_people_f but in Hyperion Planning Dimension is ONLY Employee.
Your response highly appreciated.
Chreeez
Sher -
How to get data from Oracle to SAP
Hi All,
I want to get data from Oracle to my internal table in SAP,
I worked on puting the data from SAP to Oracle, it's working fine...
Can anybody suggest the code for accessing from Oracle with 4 primary keys in oracle.
regards
manishhi
good
there is two things in sap open sql and native .if you ll use the open sql than you can access any database.
thanks
mrutyun -
How to Extract Data from Oracle DB ?
hi,
I am trying to Extract Data from Oracle DB using DBconnect. and looks like its not working. Not able to connect to Database.
thanksHi,
Can you please follw the below steps:
If you need to load data from an Oracleu2122 database use DB Connect instead of an ETL Tool
Although limited to full updates, it allows true u201Chands-offu201D automation of data extraction
Is not limited to Oracleu2122 databases, it supports ALL database systems supported by SAP BW
DB Connect can read the remote data dictionary, replicate table and views, and transfer metadata into the SAP BW Meta Data Repository.
1.Begin with your data model
2.Identify which tables provide:
Master Data
Transactional Data
3.Once the model is complete:
Obtain a UID and Password from the DBA
Ensure that table synonyms are not used u2013 they donu2019t work at this point in time (SAP Note # 518241)
Your UID has to have select permissions on the required database objects.
4.In the admin workbench open the modeling tab and select Source Systems
5.In the right pane, right-click on Source Systems and select Createu2026
6. you have to define the type of source system. Select u201CDatabase Systemu201D
7.Enter a description for the source system
8.Once you accept the definition of the source system, you have to provide the following information, save and back out:
DBMS: ORA (Oracle)
User Name: Your UID
DB password: Your pwd
Conn. Info: sql*net string
Select u201CPermanent connectionu201D if this is the case
9.If everything went well, you should see the new source system. When you do a right-click and ask for the DataSource overview, the first time you execute it you will be prompted to generate the application hierarchy. Answer yes to the prompt and then you will be able to see the DataSource tree.
10.In order to test connectivity, right-click on the source system and select u201CSelect Database Tablesu201D
11.Click on the execute button.
12.Next shows up displaying any tables or views that you have access through your UID
13.Select a table or view and click on u201CEdit DataSourceu201D.
14.To test data retrieval, click on u201CDisplay table contentsu201D
15.Designate the application component, determine the type of DataSource (Text, Master data, or Transaction data) then generate the DataSource.
16.For each applicable table/view generate the repeat steps 13 to 15.
17.From there, assign the DataSource to each target (InfoObject, InfoProvider) as usual.
Moving from Dev to QA to Prod:
18.Before transporting all you configuration work, you will have to manually set up the source system (Steps 4 to 8) in your QA or Prod
19.Depending on your authorization settings in Production, you may need to implement a system restore. Work with BASIS if you need to, donu2019t do it on your own!
20.Then transport your InfoObjects, InfoProviders, Update Rules, Transfer Rules, InfoPackages, etc.
21.If you developed the process chains, transport them separately.
22.Try to maximize throughput by using parallel processing of master data
23.Ensure the right sequence for transactional data loads is followe.
24.Combine the master data loads and the transactional data loads in a master process chain.
It can be help full.
Regards,
Maybe you are looking for
-
Is it safe to use Chrome in new MacBook Air now?
Is it still crashing?
-
Using Image Metadata On Book Page - Can't Make It Work!
I've created a book of images. I've added a metadata box on the page template (the metadata desired is the version name of the image), and what I want to happen is to have the Version Name automatically printed -- for the image used on that page -- o
-
Naming Convention for path in Application Server
Hello Guru's, I asked my basis team to create flat file source system. he asked me " what path to follow, any sub directories"?. they are asking me naming convention for a path in App server to create i think ? usually what will
-
What happened to the cache?
My cache is completely empty. Caching has always been on. I haven't cleared my cache in the last few weeks. I search the cache for 'hidden' URIs; for example, I want to download an swf or mp3 file that the website doesn't expose but plays through a c
-
Encore: Audio from imported mpeg goes missing 1/4 of the way through the video
I have an mpeg that I imported into Encore and the audio stops working part of the way through the video. There are no issues with the audio outside of Encore...it plays throughout the entire video. Any suggestions on what could be the issue?