Problem in using String in Implicit Cursor
Hi,
I am facing problem in using String in Implicit Cursor:
I have initialise
DECLARE
v_grant varchar2(4000);
begin
v_grant:='SELECT TABLE_NAME FROM DUMP_USER_TABLES WHERE TABLE_NAME LIKE ';
FOR obj IN (SELECT v_grant||'''BS%''' FROM dual) LOOP
V_REVOKE:='REVOKE ALL ON ' || 'obj.TABLE_NAME' || ' FROM ' || '''TEST''';
DBMS_OUTPUT.PUT_LINE('THE REVOKE STATEMENT IS'||V_REVOKE);
num := num + 1;
END LOOP;
END;
I am not getting the value from obj.TABLE_NAME its coming as 'obj.TABLE_NAME'
Kindly anyhelp will be needful for me
Besides from what Sybrand already pointed out clearly:
Your example doesn't run at all:
MHO%xe> DECLARE
2 v_grant varchar2(4000);
3 begin
4 v_grant:='SELECT TABLE_NAME FROM DUMP_USER_TABLES WHERE TABLE_NAME LIKE ';
5 FOR obj IN (SELECT v_grant||'''BS%''' FROM dual) LOOP
6 V_REVOKE:='REVOKE ALL ON ' || 'obj.TABLE_NAME' || ' FROM ' || '''TEST''';
7 DBMS_OUTPUT.PUT_LINE('THE REVOKE STATEMENT IS'||V_REVOKE);
8 num := num + 1;
9 END LOOP;
10 END;
11 /
V_REVOKE:='REVOKE ALL ON ' || 'obj.TABLE_NAME' || ' FROM ' || '''TEST''';
FOUT in regel 6:
.ORA-06550: line 6, column 1:
PLS-00201: identifier 'V_REVOKE' must be declared
ORA-06550: line 6, column 1:
PL/SQL: Statement ignored
ORA-06550: line 7, column 49:
PLS-00201: identifier 'V_REVOKE' must be declared
ORA-06550: line 7, column 1:
PL/SQL: Statement ignored
ORA-06550: line 8, column 1:
PLS-00201: identifier 'NUM' must be declared
ORA-06550: line 8, column 1:
PL/SQL: Statement ignoredI guess you need to read up on quoting strings properly and probably also dynamic SQL.
But:
WHAT are you trying to do anyway?
I cannot parse your code at all...so what is your requirement in human language?
Similar Messages
-
How can I use phonetic fonts for cursors name
Hi all!
I need to use phonetic characters in cursors names. Does somebody know wich font I have to use for this ?
One other problem is that I need to use Vietnamese characters at the same time. Is it possible to change the font of the cursors names run-time (in the diagram)?
Last quetion: Does LabVIEW support unicode? If yes,how can I use it?
Thank you for your help!
Nico> Effectively, dual-byte encodind is allright to support Vietnamese and
> Western languages. But how did I get the phonetics characters? With
> shortcut key ?
> As I need the user to change the cursor name run-time without using
> the frontpannel cursor legend, I'm using property node and a subVI
> asking for this name. (The user will enter the name in a string
> control).
> Moreover I would like the user to have the possibility to choose a
> character in a pannel (something similar to the menu 'insert symbol'
> in MS Word). Is it possible to do this ? With Active X maybe, but I
> don't know which activeX objet I can use....(I am not very familiar
> with ActiveX).
Unfortunately, I don't know what the phonetic characters look like, so I
can't
tell you what to type to enter them. If you find them in Word,
you should be able to copy them to the clipboard, they will be in
Unicode, and paste them into LV -- where they will be converted to dual
byte. If it doesn't work, try to find out if they are exist in the
locale of your machine, or more importantly, the target machine.
If you can display them, you can build a simple ring with short strings
containing the phonetic characters. When the user picks something from
the ring, use the strings property and value to index out the string and
replace/append to the string the user is editing. You will want to pay
attention to the string's selection if this is supposed to act like a
character palette and either do an insert or replace.
If you want a more compact grid menu, you will need to convert the
strings to images and paste them in a pict menu. That value can be used
to index a constant array that matches the order in the pict ring.
Greg McKaskle -
We encountered a problem during use the Configtool access JAVA engine.
We encountered a problem during use the Configtool access JAVA engine.
Our environment of system as below:
HardWard: IBM i570
OS: IBM as/400 V5E3
DB: DB2/400
Application system:SAP XI 3.0
The problem we encountered as below:
Our company used XI 3.0 SR1 for exchange data between SAP R/3 and no-sap system.For now,we wanna create a backup system(for
offline recovery),so we backup the XI product system throught entiry system save in AS/400(we stopped the XI system before
save process start).And following,we restored from the tape that we save from XI product system to the new backup system(they
are whole different paratition),but the problem is coming.Describe as following item:
1. The application seem to can be started but the java node always restart circularly(We have 4 java node now),I think
because of different of hardware configure(between XI product and Backup system) and lack of hardware resource.(XI prduction
have 5 CPUs and 22G Mem,Backup system have 2 CPUs and 16G MEM ).Therefore we wanna decrease the number of java nodes for
start application in backup system(throught configtool).
2. We wanna use configtool to decrease the java nodes for start backup system.But we encountered a problem during running the
configtool ,the information of prompt dialog as following:
Error occurred while working with Configuration (Scanning).
Msg:Error while connecting to DB.
We also see the system.log that below the directory of usr\sap\PXI\DVEBMGS00\j2ee\configtool,and found some error as
following text:
#1.5#C0000A0008A8000000000000017A906E000423BFFC7246E0#1165207387826#/System/Configuration/Logging##com.sap.tc.logging.APILogg
er.LogController[addLog()]#######Thread[main,5,main]##0#0#Info##Java#TC_LOGGING_CONFIGURATION_NEW_ITEMS
[C0000A305666000000000002018FB1F70003D67C779ECE88]##The () has been added to the !#3#Log#.
system.log#/System#
#1.5#C0000A0008A8000000000001017A906E000423BFFC73A670#1165207388006#/System/Server##com.sap.engine.core.configuration#######T
hread[main,5,main]##0#0#Info#1#com.sap.engine.core.configuration#Plain###ConfigurationManager: found jar for secure store
Z:
sapmnt
PXI
global
security
lib
tools
iaik_jce_export.jar#
#1.5#C0000A0008A8000000000002017A906E000423BFFC73CD80#1165207388016#/System/Server##com.sap.engine.core.configuration#######T
hread[main,5,main]##0#0#Info#1#com.sap.engine.core.configuration#Plain###ConfigurationManager: found jar for secure store
Z:
sapmnt
PXI
global
security
lib
tools
iaik_jsse.jar#
#1.5#C0000A0008A8000000000003017A906E000423BFFC73CD80#1165207388016#/System/Server##com.sap.engine.core.configuration#######T
hread[main,5,main]##0#0#Info#1#com.sap.engine.core.configuration#Plain###ConfigurationManager: found jar for secure store
Z:
sapmnt
PXI
global
security
lib
tools
iaik_smime.jar#
#1.5#C0000A0008A8000000000004017A906E000423BFFC73CD80#1165207388016#/System/Server##com.sap.engine.core.configuration#######T
hread[main,5,main]##0#0#Info#1#com.sap.engine.core.configuration#Plain###ConfigurationManager: found jar for secure store
Z:
sapmnt
PXI
global
security
lib
tools
iaik_ssl.jar#
#1.5#C0000A0008A8000000000005017A906E000423BFFC73CD80#1165207388016#/System/Server##com.sap.engine.core.configuration#######T
hread[main,5,main]##0#0#Info#1#com.sap.engine.core.configuration#Plain###ConfigurationManager: found jar for secure store
Z:
sapmnt
PXI
global
security
lib
tools
w3c_http.jar#
#1.5#C0000A0008A8000000000006017A906E000423BFFC9C25A0#1165207390660#/System/Configuration/Logging##com.sap.tc.logging.APILogg
er.LogController[setResourceBundleName(String resourceBundleName)]#######Thread[main,5,main]
##0#0#Info##Java#TC_LOGGING_CONFIGURATION_IS_CHANGED[C0000A305666000000000000018FB1F70003D67C779CD2B8]##The for the
has been changed from to )!#5#resource bundle
name#LogController#com.sap.security.core.server.secstorefs.SecStoreFS#<null>#com.sap.security.core.server.secstorefs.SecStore
FSResources#
#1.5#C0000A0008A8000000000007017A906E000423BFFC9C4CB0#1165207390670#/System/Configuration/Logging##com.sap.tc.logging.APILogg
er.LogController[setResourceBundleName(String resourceBundleName)]#######Thread[main,5,main]
##0#0#Info##Java#TC_LOGGING_CONFIGURATION_IS_CHANGED[C0000A305666000000000000018FB1F70003D67C779CD2B8]##The for the
has been changed from to )!#5#resource bundle
name#LogController#/System/Security/SecStoreFS#<null>#com.sap.security.core.server.secstorefs.SecStoreFSResources#
#1.5#C0000A0008A8000000000008017A906E000423BFFCAC7D38#1165207391731#/System/Server##com.sap.engine.core.configuration#######T
hread[main,5,main]##0#0#Info#1#com.sap.engine.core.configuration#Plain###OpenSQLDataSource successfully created with secure
store.#
#1.5#C0000A0008A8000000000009017A906E000423BFFCDA3070#1165207394726#/System/Configuration/Logging##com.sap.tc.logging.APILogg
er.LogController[setResourceBundleName(String resourceBundleName)]#######Thread[main,5,main]
##0#0#Info##Java#TC_LOGGING_CONFIGURATION_IS_CHANGED[C0000A305666000000000000018FB1F70003D67C779CD2B8]##The for the
has been changed from to )!#5#resource bundle
name#LogController#/System/Database/sql/jdbc#<null>#com.sap.sql.log.OpenSQLResourceBundle#
#1.5#C0000A0008A800000000000A017A906E000423BFFCDB41E0#1165207394796#/System/Database/sql/jdbc##com.sap.sql.jdbc.NativeConnect
ionFactory#######Thread[main,5,main]
##0#0#Error#1#com.sap.sql.jdbc.NativeConnectionFactory#Java#com.sap.sql_0002#com.sap.sql.log.OpenSQLResourceBundle#SQL error
occurred on connection : code={0,number,integer}, state="", message="".#5#-99999#08001#The application requester
cannot establish the connection. (XIPRD)#jdbc:as400://XIPRD/SAPPXIDB;transaction isolation=read uncommitted;data
truncation=true;date format=jis;time format=jis;sort=hex;hold input locators=true;hold statements=true;cursor
hold=false#<null>#
The "SQL error occurred on connection" happened during start run configtool.
We don't know how to solve this problem.
ThanksI am unable to start my configtool.bat to administer JVM memory settings for my J2EE.
Wait......
Thanks -
Difference between implicit cursor and explicit cursor.
hi all,
i have used explicit cursor, i know the way of using implicit cursor, but i don't what the difference between both.
Is they both are different. if yes y? which cursor is most reliable to use.
please tell me..
Thanks..OK,
1- An IMPLICIT cursor is automatically declared by Oracle every time an SQL statement is executed The user will not be aware of this happening and will not be able to control or process
the information in an implicit cursor.
Example:
SET SERVEROUTPUT ON
BEGIN
UPDATE Customers
SET Cust_name = 'B'
WHERE Cust_name LIKE 'B%';
DBMS_OUTPUT.PUT_LINE(SQL%ROWCOUNT);
END;
2- An EXPLICIT cursor is defined by the program for any query that returns more than one row of data.
That means the programmer has declared the cursor within the PL/SQL code block. This declaration allows for the application to sequentially process each row of data as it is returned by the cursor.
Example :
DECLARE
CURSOR C_MyCursor IS
SELECT *
FROM bookings
WHERE Cust_no = 701;
see this post
http://comsci.liu.edu/~vasilaky/db2/cursors.htm :-) -
Problem with passing date parameters in cursor
Is there any problem in passing date parameters and like clause as below
CURSOR eftcursor(start_date DATE, end_date DATE, where_clause varchar2) IS
select * from r_records
where created_date between start_date and end_date and description like where_clause;
and in the open statement
select to_date('01/06/2010 00:00:00', 'dd/mm/yyyy hh24:mi:ss') into startDate from dual;
select to_date('01/07/2010 00:00:00', 'dd/mm/yyyy hh24:mi:ss') into endDate from dual;
str := '%something%aaaaa%';
open eftcursor(startDate ,endDate , str);
Do i need to do any kind of conversion in the cursor where clause or when i am passing the parameter in open statement.Almora wrote:
Do i need to do any kind of conversion in the cursor where clause or when i am passing the parameter in open statement.No, your code looks correct -- ou're passing a date to the cursor.
You might consider whether you really need an explicit cursor though. An implicit cursor is easier to code and performs better. -
Hi,
Can anyone let me know how to close an implicit cursor opened for every individual sql statement? Please note that I am talking about the implicit cursor, not the explicit cursor. I am reaching the maximum open cursor limit and I don't want to increase the open_cursor parameter further as i have already set it a very big value (10000). Rather I would like to know how to close the implicit cursors opened by oracle itself.
Please help.
Thanks in advance.Thanks for your advice. In fact we have already
started re-constructing our coding using explicit
cursor. But the thing is even if the implicit cursors
are kept open till the session ending, it should be
closed when the maximum open_cursor limit is reached
by oracle itself.
The work arroud is well accepted, but I am very eager
to know whether somehow implicit cursor can be closed
or not.You have cursor leaks in your application. Are you closing the cursors? In JDBC (I know you said VB.Net but I don't know much about VB) you call the close method on the Statement objects. May be you are closing most of the cursors but a few are not being closed. In that case, the number of open cursors will slowly creep up to a high number. How often does this error come up? How long before you start seeing it?
Also, take a look at the v$open_cursor view (using your session SID) when you get the error and see if there are certain statements that are repeated a ton of times. This could help you find those statements that are not closed by the application.
Also note, there is a dbms_sql.close_cursor method. Check it out:
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96590/adg09dyn.htm#26799
-Raj -
How to retrieve IndividualStrings from a txt file using String Tokenizer.
hello can any one help me to retrieve the individual strings from a txt file using string tokenizer or some thing like that.
the data in my txt file looks like this way.
Data1;
abc; cder; efu; frg;
abc1; cder2; efu3; frg4;
Data2
sdfabc; sdfcder; hvhefu; fgfrg;
uhfhabc; gffjcder; yugefu; hhfufrg;
Data3
val1; val2; val3; val4; val5; val6;
val1; val2; val3; val4; val5; val6;
val1; val2; val3; val4; val5; val6;
val1; val2; val3; val4; val5; val6;
i need to read the data as an individual strings and i need to pass those values to diffarent labels,the dat in Data3 i have to read those values and add to an table datamodel as 6 columns and rows depends on the data.
i try to retrieve data using buffered reader and inputstream reader,but only the way i am retrieving data as an big string of entire line ,i tried with stringtokenizer but some how i was failed to retrive the data in a way i want,any help would be appreciated.
Regards,Hmmm... looks like the file format isn't even very consistent... why the semicolon after Data1 but not after Data2 or Data3??
Your algorithm is reading character-by-character, and most of the time it's easier to let a StringTokenizer or StreamTokenizer do the work of lexical analysis and let you focus on the parsing.
I am also going to assume your format is very rigid. E.g. section Data1 will ALWAYS come before section Data2, which will come before section Data3, etc... and you might even make the assumption there can never be a Data4, 5, 6, etc... (this is why its nice to have some exact specification, like a grammar, so you know exactly what is and is not allowed.) I will also assume that the section names will always be the same, namely "DataX" where X is a decimal digit.
I tend to like to use StreamTokenizer for this sort of thing, but the additional power and flexibility it gives comes at the price of a steeper learning curve (and it's a little buggy too). So I will ignore this class and focus on StringTokenizer.
I would suggest something like this general framework:
//make a BufferedReader up here...
do
String line = myBufferedReader.readLine();
if (line!=null && line.trim().length()>0)
line = line.trim();
//do some processing on the line
while (line!=null);So what processing to do inside the if statement?
Well, you can recognize the DataX lines easily enough - just do something like a line.startsWith("Data") and check that the last char is a digit... you can even ignore the digit if you know the sections come in a certain order (simplifying assumptions can simplify the code).
Once you figure out which section you're in, you can parse the succeeding lines appropriately. You might instantiate a StringTokenizer, i.e. StringTokenizer strtok = new StringTokenizer(line, ";, "); and then read out the tokens into some Collection, based on the section #. E.g.
strtok = new StringTokenizer(line, ";, ");
if (sectionNo==0)
//read the tokens into the Labels1 collection
else if (sectionNo==1)
//read the tokens into the Labels2 collection
else //sectionNo must be 2
//create a new line in your table model and populate it with the token values...
}I don't think the delimiters are necessary if you are using end-of-line's as delimiters (which is implicit in the fact that you are reading the text out line-by-line). So the original file format you listed looks fine (except you might want to get rid of that rogue semicolon).
Good luck. -
Question on Synonyms and Implicit Cursor
Hi,
I've two doubts.
Question1:
Why Oracle is allowing me to create a synonym even base object does not exist in database.
For example in below example user ABC and object def doesnt exist in my database. Why I didnt get any error while creating a synonym.
Connected to Oracle Database 11g Express Edition Release 11.2.0.2.0
Connected as hr
SQL> CREATE SYNONYM test_syn FOR ABC.def;
Synonym created
SQL> Question2:
In PL/SQL after closing the cursor if we use any cursor attribute it will throw exception like invalid cursor. Why it is not happening in case of implicit cursor.
Or
Does Oracle close implicit cursor(SQL) ?
declare
begin
UPDATE emp
SET ename = 'SURI';
COMMIT;
dbms_output.put_line(SQL%rowcount);
end;Many thanks for all your help.
Cheers,
SuriSuri wrote:
Hi,
I've two doubts.
Question1:
Why Oracle is allowing me to create a synonym even base object does not exist in database.
For example in below example user ABC and object def doesnt exist in my database. Why I didnt get any error while creating a synonym.If you look in the all_dependencies view you will see that it's created as "NON-EXISTENT", so oracle knows it's non existent, it just doesn't treat it as an error.
As it says in the documentation:
http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_7001.htm#SQLRF01401
A dependency is created and if the target object is changed or dropped etc. the synonym becomes invalid... but that doesn't mean it cannot exist.
Question2:
In PL/SQL after closing the cursor if we use any cursor attribute it will throw exception like invalid cursor. Why it is not happening in case of implicit cursor.Would you care to demonstrate what you mean with some code. -
Problem in using MySQL in JSF Pages
Hi,
I am facing a problem regarding use of MySQL in JSF.
I am using IBM RAD 6.0 for application developement.
Previously creating a normal java application which is used of retrieval of the data from the database was working fine. by including j/connector jar file in java build path.
But when same program is converted to web service and accessed through a JSF page using a managed bean it is not working. It throws classNotFoundException
Please reply at your earliest.
Thanks in advance.
Regards,
Amit
code :-
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class BeanClass
public String display()
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
String returnDate = "";
try
Class.forName("com.mysql.jdbc.Driver").newInstance();
System.out.println("Sucess");
conn=DriverManager.getConnection("jdbc:mysql://localhost/switching","root","pspl");
System.out.println("Sucess******");
stmt = conn.createStatement();
System.out.println("Sucess^^^^^^^^^");
rs = stmt.executeQuery("SELECT * FROM log1 where senderId = '008' ");
System.out.println("Sucess#########");
while(rs.next())
System.out.println("Date : " + rs.getString("expDate"));
returnDate = rs.getString("expDate");
System.out.println("Final success");
System.out.println("Sucess@@@@@@@@@@@@@@@@");
}catch(ClassNotFoundException cnfe)
System.err.println("Drivers not found " + cnfe.toString());
cnfe.printStackTrace();
catch(IllegalAccessException iae)
System.err.println("Access Exception");
catch(InstantiationException ie)
System.err.println("Instatiation Exception");
catch(SQLException se)
System.err.println("SQL EXCEPTION");
se.printStackTrace();
System.out.println("Date is = " + returnDate);
return returnDate;
Errors are :-
[5/3/06 10:47:33:358 IST] 00000061 SystemErr R java.lang.ClassNotFoundException: com.mysql.jdbc.Driver at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java(Compiled Code))
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java(Compiled Code))
at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
at java.lang.Class.forName1(Native Method)
at java.lang.Class.forName(Class.java(Compiled Code))
at packBean.BeanClass.display(BeanClass.java:29)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at com.ibm.ws.webservices.engine.dispatchers.java.JavaDispatcher.invokeMethod(JavaDispatcher.java:178)
at com.ibm.ws.webservices.engine.dispatchers.java.JavaDispatcher.invokeOperation(JavaDispatcher.java:141)
at com.ibm.ws.webservices.engine.dispatchers.SoapRPCProcessor.processRequestResponse(SoapRPCProcessor.java:423)
at com.ibm.ws.webservices.engine.dispatchers.SoapRPCProcessor.processMessage(SoapRPCProcessor.java:388)
at com.ibm.ws.webservices.engine.dispatchers.BasicDispatcher.processMessage(BasicDispatcher.java:134)
at com.ibm.ws.webservices.engine.dispatchers.java.SessionDispatcher.invoke(SessionDispatcher.java:203)
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:225)
at com.ibm.ws.webservices.engine.handlers.jaxrpc.JAXRPCHandler.invoke(JAXRPCHandler.java:151)
at com.ibm.ws.webservices.engine.handlers.WrappedHandler.invoke(WrappedHandler.java:64)
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:225)
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:225)
at com.ibm.ws.webservices.engine.WebServicesEngine.invoke(WebServicesEngine.java:279)
at com.ibm.ws.webservices.engine.transport.http.WebServicesServlet.doPost(WebServicesServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at com.ibm.ws.webservices.engine.transport.http.WebServicesServletBase.service(WebServicesServletBase.java:341)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1282)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:673)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:80)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1802)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:84)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:469)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:408)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:286)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:201)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:103)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))You have to put myfaces jar on the web-inf/lib
-
Problems with the Strings Urgent Help needed
I have a unique problem. I have to retrieve a particular value from a String. I tried using String tokeniser but in vain. I cannot use java.util.regex package to match the expressions as the version of java on the client m/c is 1.1.8 and they are not ready to upgrade the same.
The string From which I have is a very long one running into more than 100 lines which can vary from case to case all I know is to retrieve the value which is just in front of "TestValue" which occur only once in the String Can Anybody suggest a bettter alternative.
Thanx.
ebistrioStringTokenize on TestValueHow would you suggest that was done?
As I understand it StringTokenizer tokens = new StringTokenizer(string, "TestValue"); would not tokenize on the string "TestValue" but on any of the characters 'T', 'e', 's', 't', 'V', 'a', 'l' or 'u'. This is a common java pitfall in my opinion due to bady named parameters (I feel it should be called "delims" not "delim") or in other people's opinion due to bad parameter type (should be a char[] not a string).
A clearer explanation of the problem would help. -
Problem in using SAX parser.
Hai All,
I have got a problem in using SAX parser.
My XML looks like this:
<authorizer>
<first-name>HP</first-name>
<last-name>Services</last-name>
<phone>800-22-1984</phone>
</authorizer>
<destination>
<first-name>John</first-name>
<last-name>Doe</last-name>
<company>John Doe Enterprises, Inc.</company>
<department>Manufacturing</department>
<phone>800-555-1234</phone>
<address>
<street-one>1654 Peachtree Str</street-one>
<street-two>Suite Y</street-two>
<city>Atlanta</city>
<province>GA</province>
<country>US</country>
<postal-code>30326</postal-code>
</address>
</destination>
my part of SAX parser code is:
public void startElement (String name, AttributeList attrs)
throws SAXException
accumulator.setLength(0);
public void characters (char buf [], int offset, int len)
throws SAXException
accumulator.append(buf, offset, len);
public void endElement (String name)
throws SAXException
if (name.equals("first-name") )
firstname=accumulator.toString().trim();
if (name.equals("last-name"))
lastname=accumulator.toString().trim();
My problem is that i have to store the values of first-name and last-name.
but i have that in both
<authorizer> </authorizer> Tag and
<destination> </destination>
I need to retrive authorizer's firstname,lastname and
destination's firstname and lastname.
what i mean is i need to store authorizerFirstName,authorizerLastName
destinationFirstname and destinationLastname.
Pls let me know how to do that.
Thanks in advance.
Pooja.hi pooja,
I think you are using DataHandler for parsing. Its deprecated. try using contentHandler . You can get the value of the element at the beginning. say for example
<firstname>sdfs</firstname>
the startElement will be firstname
the next method that it invokes will be characters method which has the text associated with the element. I am sending a sample code for your problem. try using it .
boolean m_boolinAuth = false;
boolean m_boolinDest = false;
boolean m_bAuthFName = false;
boolean m_bAuthLName = false;
public void startElement(String namespaceURI, String elementName, String qName, Attributes atts)
//does the logic for startElement
if(qName.equals("Authorization"))
m_boolinAuth = true;
m_boolinDest = false;
else if(qName.equals("Destination"))
m_boolinDest = true;
m_boolinAuth = false;
if(qName.equals("firstname"))
m_bFirstName = true;
if(qName.equals("lastname"))
m_bLastName = true;
public void characters(char[] ch, int start, int length)
//does the logic for characters.
String str = new String(ch,start,length);
if(m_bFirstName)
if(m_boolinAuth)
m_strAuthFirstName =str;
else if(m_boolinDest)
m_strDestFirstName = str;
m_bFirstName = false;
if(m_bLastName)
//same as first name case;
} -
Problem in using java print API
I am facing a problem in using printAll and printComponents API.
The application was developed in java1.1
Now the same application is migrated to java 1.4
But the reports are not being printed in desired format.
The application make use of printAll() API of Component.
Using java1.1 the print output is without the borders for components like textField or TextArea,
whereas for java 1.4 we get border and scrollbar on print which is not the desired output.
Can anybody suggest a solution for the same?
here is the sample code, you can see the difference by executing this code in java1.1 and java 1.4.
import java.awt.*;
import java.util.*;
public class TestPrint extends Frame implements java.awt.event.ActionListener {
PrintJob job = null;
//Frame aFrame = new Frame("Test Frame");
private TextArea txaChangeNotes = null;
private Label lb = null;
private Panel ivjContentsPane = null;
private Button ivjButton1 = null;
TestPrint () {
super("Test Frame");
init();
private void init() {
ivjContentsPane = new java.awt.Panel();
ivjContentsPane.setName("ContentsPane");
txaChangeNotes = new java.awt.TextArea("",0,0,java.awt.TextArea.SCROLLBARS_BOTH);
txaChangeNotes.setText("****\n&&&");
ivjButton1 = new java.awt.Button();
ivjButton1.setName("Button1");
ivjButton1.addActionListener(this);
ivjContentsPane.add(txaChangeNotes);
ivjContentsPane.add(lb);
ivjContentsPane.add(ivjButton1);
this.add(ivjContentsPane);
setSize(595, 735);
show();
public void actionPerformed(java.awt.event.ActionEvent e) {
Object obj = e.getSource() ;
if( obj instanceof java.awt.Button ){
//Button but = e.getSource();
print();
private void print() {
System.out.println("In Print");
job = getPrintJob(this , "Print All Parts");
//job.setPrintable(this);
if(job!=null){
System.out.println("Job not null");
/*if (job.printDialog()) {
try {
System.out.println("printing");
job.print();
} catch (Exception ex) {
ex.printStackTrace();
Graphics pg=job.getGraphics();
if(pg!=null){
System.out.println("graphics not null");
this.requestFocus();
//this.printComponents(pg);
this.printAll(pg);
}else{
System.out.println("graphics null");
//this.dispose();
return;
pg.dispose();
}else{
System.out.println("job null");
//this.dispose();
return;
job.end();
private PrintJob getPrintJob (Frame aFrame,String aString) {
Properties printprefs = null;
Toolkit toolkit = java.awt.Toolkit.getDefaultToolkit();
PrintJob job = toolkit.getPrintJob(aFrame, aString, printprefs);
/*JobAttributes jab = null;
jab = new JobAttributes();
PageAttributes pab = null;
pab = new PageAttributes();
pab.setPrinterResolution(70);
jab.setDialog(JobAttributes.DialogType.COMMON);
PrintJob job = Toolkit.getDefaultToolkit().getPrintJob(aFrame, aString, jab, pab);*/
return job;
public static void main(String arg[]){
TestPrint objTestPrintFrame = new TestPrint();
}You must not have the complete IFS_BASE_CLASSPATH defined in your CLASSPATH environment variable. The easiest way to do this is to type ". ifsenv.sh" on Solaris (or run ifsenv.bat on NT). Then you can invoke java like this:
java -classpath $CLASSPATH:$IFS_BASE_CLASSPATH ...
(your standard JDK classes should already be in the CLASSPATH; append our classpath to it) -
In the following block, I am unable to figure out how to catch
no_data_found in the SQL within the for loop.
no_data_found in the exception part doesn't catch it. Any ideas
would be much appreciated.
begin
for xx in(select ename from emp where hire_date > trunc(sysdate,'MM'))
loop
dbms_output.put_line('ename '||xx.ename);
end loop;
exception
when no_data_found then dbms_output.put_line('no record found');
end;
thanks.
arnikoThe NO_DATA_FOUND exception is only raised when using an implicit cursor in PL/SQL. E.g.
select f.id into my_variable from foo f where f.day = trunc(sysdate);
..When opening a cursor, where you deal with the actual cursor handle (variable xx in your sample code), you use an explicit cursor reference. And in this case, the exception is not raised and you're expected to use the cursor variable called %NOTFOUND instead. -
Problem with use of COM+ Transaction and DB Transaction
Problem with use of COM+ Transaction and DB Transaction
We build a Web site that use sometime COM+ Transaction and sometime DB
Transaction. If we use a COM+ Transaction and a few seconds later we try to use
a Database Transaction (OracleConnection.BeginTransaction), we get the error
Connection is already part of a local or a distributed transaction
Of course the error does not produce everytime; it takes some try before we get
the problem. And of course, if i use pooling=false on the connection string,
the problem does not appear.
i run the Web page
and push the COM+ Transaction and DB Transaction one after the other for some
times and the problem should appear.
Environment: Windows server 2003, .Net Framework 1.1, ODP.Net 9.2.0.401,
Database Server 9.2.0.4> Why in form builder can't I...
Is this happening at runtime or at buildtime? You'll need to provide more info on what you are actually doing that's causing the problem.
Regards,
Robin Zimmermann
Forms Product Management -
CL_GUI_ALV_GRID Problems when using enter and f4 in one ALV
Hi guys,
i have the following problem:
I Use a ALV, which has a column MATNR. The ALV provides the standard search help for this field automatically. so far so good. BUT i also need to read additional data, such as GLD, Material shortext etc, when the users presses the Enter Key.
Here is my coding:
CLASS lcl_events DEFINITION
CLASS lcl_events_0300 DEFINITION.
PUBLIC SECTION.
METHODS:
handle_data_changed
FOR EVENT data_changed OF cl_gui_alv_grid
IMPORTING er_data_changed sender.
ENDCLASS. "lcl_events DEFINITION
The problem that occurs: if i select a material via f4, i just can add one material to the alv. if i place the cursor into the second line, press f4 again, the alv overwrites the MATNR in the first line
i think the problem has to do with the fact, that the alv runs throug my enter event, when pressing f4.
thats how i registered my event:
g_o_alv_grid_bart_0300->register_edit_event(
EXPORTING
" i_event_id = g_o_alv_grid->MC_EVT_MODIFIED ).
i_event_id = g_o_alv_grid->mc_evt_enter ).
...und EventHandler zuweisen
CREATE OBJECT g_o_alv_events_0300.
SET HANDLER g_o_alv_events_0300->handle_data_changed FOR g_o_alv_grid_bart_0300.
kind regards, mark
Edited by: Mark Wagener on Aug 19, 2010 11:39 AM
Edited by: Mark Wagener on Aug 19, 2010 11:40 AMSorry for forgetting the impl. part of the class!
CLASS lcl_events_0300 IMPLEMENTATION
CLASS lcl_events_0300 IMPLEMENTATION.
METHOD handle_data_changed.
HandleDataChanged ***
DATA: ls_good TYPE lvc_s_modi.
FIELD-SYMBOLS: .
alle Inhalte der geänderten Zellen in die interne Tabelle schreiben
LOOP AT er_data_changed->mt_good_cells INTO ls_good.
Dazu auf die richtige Zeile in der ITAB positionieren:
READ TABLE INDEX ls_good-row_id.
IF sy-subrc = 0.
Und das geänderte Feld dem Feldsymbol zuweisen
ASSIGN COMPONENT ls_good-fieldname OF STRUCTURE .
IF sy-subrc = 0.
Feldwert zuweisen
-matnr
AND bwkey = werks.
ENDLOOP.
Und neu ausgeben
g_o_alv_grid_bart_0300->refresh_table_display( ).
ENDMETHOD. "handle_data_changed
Maybe you are looking for
-
Quicktime 7 for windows will not install.
I know that all videos on apple.com require the latest version of quicktime, so I follow the links to the download page. I download quicktime 7 for XP or Vista. When I run the program installer, it tells me I must either 'repair' or 'remove' quicktim
-
Inconsistent space after graphic frames
Hi, I'm trying to create a consistent-looking manual, where space after imported graphics is consistent. Currently, that is not proving to be easy. For example, look at the difference between the space after the first and second graphics below (the f
-
I've recently updated to Itunes 7. It seems to install fine but I can never run the program. It says "Itunes application could not be opened. An unknown error occurred (-200). I've tried un-installing it and reinstalling. Didn't work. I've even gone
-
Manufacurer code in Purchase Order
Hi , Is there any place where we can attach actual manufacrurer in PO item. Regards/SANDEEP
-
Idle in safari and it closes my session
If I open a tab in safari, then leave it unattended it closes the connection. This is crazy. I have to relog in every time i want to use the tab. I used to be able to have 6 tabs open on this web page, for hours on end, and use them as i needed th