I have pbm with array in jsp
hi everyone, i m now handling project which involves jsp to asp conversion, as i m new to jsp world, so i dont no what would be the equivalent code of asp into jsp
here is two line code of asp,
dim cnt
dim boardlist
boardlist=Rs.getrows(-1)
cnt=Ubound(boardlist,2)
could u pls suggest me the equivalent code into jsp, also pls explain me what is happening in the above asp code, thank you very much
Your ASP is not declaring your variables with a type, i.e. string.
In VB you would do something line
dim cnd as string (if memory serves me correctly)
In Java you declare variables like:
String cnt; (for a string)
int boardlist; (for an integer)
In order to use RS, you have to create the database connection and execute a statement to get the resultset, search these forums for database connection code.
It is not sufficient to simply change
boardlist=rs.getrows.....
you also need to change the code that creates rs in the first place.
I would suggest you work through the sun java tutorials, you cannot expect to learn by posting a question containing 4 lines of code from a larger application!
Similar Messages
-
Problem with JavaBeans in JSP.IT'S URGENT!!!
Hi, i have problems with JavaBeans in JSP.
In a jsp file( locating in ROOT directory of tomcat 4.0.6 :jakarta-tomcat-4.0.6\webapps\root ) i have this code:
<jsp:useBean id="paramBean" class="licentza.ParamBean" />
<jsp:setProperty name="paramBean"
property="nume"
value='<%= request.getParameter("numeUser") %>' />
where ParamBean it's a "bean" class locating in jakarta-tomcat-4.0.6\webapps\examples\web-inf\classes\licentza (licentza is the package i'm using).
And i get this error:
Generated servlet error:
D:\jakarta-tomcat-4.0.6\work\Standalone\localhost\_\dora\intrare2$jsp.java:67: Class licentza.ParamBean not found.
ParamBean paramBean = null;
What is the problem?Thank you.Hi,
Put the class file or the package under :jakarta-tomcat-4.0.6\webapps\root\WEB-INF\classes.
Rajesh -
Xy graph , i have case with generated diferent arrays
Hello
I have case with A.B.C.D... options, each of this options creating different arrays wich can i want to display to the same xy graph. How can i create same graph in the diferent case ? When i creating second graph , this graph have different name a create me new graph, when i change name of graph then first , name was changed but it is not same graph.
thanksHi
use a property node/ local variable of the xy Graph in each case and update its value
Regards
Dev
Attachments:
multi property node_xy.vi 42 KB -
How to get the values of an Array using JSP Tags
Hey guys,
I need some help. I've splited a String using
fn:split(String, delim) where String = "1,2,3,4" and delim is ,
This method returns an Array of splited Strings. how do i get the values from this array using jsp tags. I don't wanna put java code to achive that.
Any help would be highly appreciated
ThanksThe JSTL forEach tag.
In fact if all you want to do is iterate over the comma separated list, the forEach tag supports that without having to use the split function.
<c:set var="list" value="1,2,3,4"/>
<c:forEach var="num" items="${list}">
<c:out value="${num}"/>
</c:forEach>The c:forTokens method will let you do this with delimiters other than a comma, but the forEach tag works well just with the comma-delimited string. -
Hi,
I have a MBP 13' Late 2011 and Yosemite 10.10.2 (14C1514).
Until yesterday, I was using Garmin ConnectIQ SDK and all was working fine.
Yesterday, I've updated my system with latest security updates and Xcode updates too (Version 6.2 (6C131e)).
Since, I can't launch the ConnectIQ simulator app, I have this message in console :
8/04/2015 15:19:04,103 mds[38]: There was an error parsing the Info.plist for the bundle at URL Info.plist -- file:///Volumes/Leto/connectiq-sdk-mac-1.1.0_2/ios/ConnectIQ.bundle/
The data couldn’t be read because it isn’t in the correct format.
<CFBasicHash 0x7fa64f44e9a0 [0x7fff7dfc7cf0]>{type = immutable dict, count = 2,
entries =>
0 : <CFString 0x7fff7df92580 [0x7fff7dfc7cf0]>{contents = "NSDebugDescription"} = <CFString 0x7fa64f44f0a0 [0x7fff7dfc7cf0]>{contents = "Unexpected character b at line 1"}
1 : <CFString 0x7fff7df9f5e0 [0x7fff7dfc7cf0]>{contents = "kCFPropertyListOldStyleParsingError"} = Error Domain=NSCocoaErrorDomain Code=3840 "The data couldn’t be read because it isn’t in the correct format." (Conversion of string failed.) UserInfo=0x7fa64f44eda0 {NSDebugDescription=Conversion of string failed.}
I have looked at this file and it looks like a binary plist
bplist00ß^P^V^A^B^C^D^E^F^G^H
^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_ !"$%&'()'+,^[\CFBundleNameWDTXcodeYDTSDKName_^P^XNSHumanReadableCopyrightZDTSDKBuild_^P^YCFBundleDevelopmentRegion_^P^OCFBundleVersi on_^P^SBuildMachineOSBuild^DTPlatformName_^P^SCFBundlePackageType_^P^ZCFBundleShortVersionString_^P^ZCFBundleSupportedPlatforms_^P^]CFBundleInfoDictionaryVersion_^P^RCFBundleE xecutableZDTCompiler_^P^PMinimumOSVersion_^P^RCFBundleIdentifier^UIDeviceFamily_^P^QDTPlatformVersion\DTXcodeBuild_^P^QCFBundleSignature_^P^ODTPlatformBuildYConnectIQT0611[iph oneos8.1o^P-^@C^@o^@p^@y^@r^@i^@g^@h^@t^@ ^@©^@ ^@2^@0^@1^@5^@ ^@G^@a^@r^@m^@i^@n^@.^@ ^@A^@l^@l^@ ^@r^@i^@g^@h^@t^@s^@ ^@r^@e^@s^@e^@r^@v^@e^@d^@.V12B411RenQ1V14C109Xiphoneos TBNDLS1.0¡#XiPhoneOSS6.0YConnectIQ_^P"com.apple.compilers.llvm.clang.1_0S8.1_^P^Tcom.garmin.ConnectIQ¡*^P^AW6A2008aT????^@^H^@7^@D^@L^@V^@q^@|^@<98>^@ª^@À^@Ï^@å^A^B^A^_^A?^AT^ A_^Ar^A<87>^A<96>^Aª^A·^AË^AÝ^Aç^Aì^Aø^BU^B\^B_^Ba^Bh^Bq^Bv^Bz^B|^B<85>^B<89>^B<93>^B¸^B¼^BÓ^BÕ^B×^Bß^@^@^@^@^@^@^B^A^@^@^@^@^@^@^@-^@^@^@^@^@^@^@^@^@^@^@^@^@^@^Bä
I guess it is a normal format but my system seems to be unable to read binary plist ?
I tried some stuff with plutil
plutil -lint Info.plist
Info.plist: Unexpected character b at line 1
Same for convert
plutil -convert xml1 Info.plist
Info.plist: Property List error: Unexpected character b at line 1 / JSON error: JSON text did not start with array or object and option to allow fragments not set.
I also try to download a fresh version of the connectIQ SDK and no changes.
Any idea ?
ThanksStep by step, how did you arrive at seeing this agreement?
-
Hello.
During developing Domain Index for Oracle 11.2.0.1.0 (problem also appears in 12с) i was faced with misunderstanding of parameter types of function
ODCIIndexInsert in case of creating indextype WITH ARRAY DML option
According to Oracle documentation
http://docs.oracle.com/cd/E11882_01/appdev.112/e10765/ext_idx_ref.htm#i76892
In case of WITH ARRAY DML option Oracle will invoke ODCIIndexInsert with following signature
FUNCTION ODCIIndexInsert(
ia ODCIIndexInfo,
ridlist ODCIRidList,
newvallist varray_of_column_type,
env ODCIEnv)
RETURN NUMBER
In my case indexed column has datatype NUMBER so i defined varray_of_column_type as SYS.ODCINumberList
STATIC FUNCTION ODCIIndexInsert(ia in sys.ODCIIndexInfo, ridlist in sys.ODCIRidList, newvallist in sys.ODCINumberList, env in SYS.ODCIEnv) RETURN NUMBER
Indextype was created as
CREATE INDEXTYPE test_index_type
FOR
test_eq(number, number)
USING index_methods
WITH ARRAY DML(number, sys.ODCINumberList)
WITH LOCAL RANGE PARTITION
WITH SYSTEM MANAGED STORAGE TABLES;
or
CREATE INDEXTYPE test_index_type
FOR
test_eq(number, number)
USING index_methods
WITH ARRAY DML
WITH LOCAL RANGE PARTITION
WITH SYSTEM MANAGED STORAGE TABLES;
(problem occurs in all cases)
CREATE TABLE test_table (id NUMBER (19,0));
CREATE INDEX test_index ON test_table(id) INDEXTYPE IS test_index_type;
When attempting to insert data in the table
insert into test_table values (1);
oracle raise exception
Error starting at line 53 in command:
insert into test_table values (1)
Error at Command Line:53 Column:1
Error report:
SQL Error: ORA-29925: cannot execute SCOTT.INDEX_METHODS.ODCIINDEXINSERT
ORA-06553: PLS-306: wrong number or types of arguments in call to 'ODCIINDEXINSERT'
ORA-06553: PLS-306: wrong number or types of arguments in call to 'ODCIINDEXINSERT'
29925. 00000 - "cannot execute %s"
*Cause: The specified function does not exist or does not have an
appropriate signature.
*Action: Implement the function with the appropriate signature.
So my question is.
Is it normal behavior of oracle (according to documentation)?
What is correct signature of ODCIIndexInsert function in case of INDEXTYPE creation with 'WITH ARRAY DML' option and fact that indexed column has NUMBER datatype?
By the way if i define indextype without 'WITH ARRAY DML' option signature is clear, and working. But this approach doesn't satisfies our performance needs.
Also if i define index type with option 'WITH ARRAY DML WITHOUT COLUMN DATA' and use signature
static function ODCIIndexInsert(ia sys.odciindexinfo, ridlist sys.odciridlist, env sys.ODCIEnv) return number
Everything works too. But this approach doesn't satisfies our business needs.
Is it a way to define ODCIIndexInsert parameter types (in case of indexing number column) so that batch inserting works according to documentation ?
FUNCTION ODCIIndexInsert(
ia ODCIIndexInfo,
ridlist ODCIRidList,
newvallist varray_of_column_type,
env ODCIEnv)
I am attaching full sql script to recreate environment and reproduce the problem.
Type definition:
CREATE OR REPLACE TYPE index_methods AS OBJECT
step number,
STATIC FUNCTION ODCIGetInterfaces(ifclist OUT SYS.ODCIObjectList) RETURN NUMBER,
STATIC FUNCTION ODCIIndexCreate (ia SYS.ODCIIndexInfo, parms VARCHAR2, env SYS.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexAlter (ia sys.ODCIIndexInfo, parms IN OUT VARCHAR2, altopt number, env sys.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexDrop(ia SYS.ODCIIndexInfo, env SYS.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexExchangePartition(ia SYS.ODCIIndexInfo, ia1 SYS.ODCIIndexInfo, env SYS.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexUpdPartMetadata(ia sys.ODCIIndexInfo, palist sys.ODCIPartInfoList, env sys.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexInsert(ia in sys.ODCIIndexInfo, ridlist in sys.ODCIRidList, newvallist in sys.ODCINumberList, env in SYS.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexDelete(ia SYS.ODCIIndexInfo, rid VARCHAR2, oldval number, env SYS.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexUpdate(ia SYS.ODCIIndexInfo, rid VARCHAR2, oldval number, newval number, env SYS.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexStart(sctx IN OUT index_methods, ia SYS.ODCIIndexInfo,
op SYS.ODCIPredInfo, qi sys.ODCIQueryInfo, strt number, stop number, cmpval number, env SYS.ODCIEnv) RETURN NUMBER,
MEMBER FUNCTION ODCIIndexFetch(self IN OUT index_methods, nrows NUMBER, rids OUT SYS.ODCIridlist, env SYS.ODCIEnv) RETURN NUMBER,
MEMBER FUNCTION ODCIIndexClose(self IN index_methods, env SYS.ODCIEnv) RETURN NUMBER
CREATE OR REPLACE TYPE BODY index_methods IS
STATIC FUNCTION ODCIGetInterfaces(ifclist OUT sys.ODCIObjectList) RETURN NUMBER IS
BEGIN
ifclist := sys.ODCIObjectList(sys.ODCIObject('SYS','ODCIINDEX2'));
RETURN ODCIConst.Success;
END ODCIGetInterfaces;
STATIC FUNCTION ODCIIndexCreate (ia sys.ODCIIndexInfo, parms VARCHAR2, env sys.ODCIEnv) RETURN NUMBER IS
BEGIN
RETURN ODCIConst.Success;
END ODCIIndexCreate;
STATIC FUNCTION ODCIIndexDrop(ia sys.ODCIIndexInfo, env sys.ODCIEnv) RETURN NUMBER IS
BEGIN
RETURN ODCIConst.Success;
END ODCIIndexDrop;
STATIC FUNCTION ODCIIndexAlter (
ia sys.ODCIIndexInfo,
parms IN OUT VARCHAR2,
altopt NUMBER,
env sys.ODCIEnv)
RETURN NUMBER IS
BEGIN
RETURN ODCIConst.Success;
END ODCIIndexAlter;
STATIC FUNCTION ODCIIndexUpdPartMetadata(
ia sys.ODCIIndexInfo,
palist sys.ODCIPartInfoList,
env sys.ODCIEnv)
RETURN NUMBER IS
BEGIN
RETURN ODCIConst.Success;
END ODCIIndexUpdPartMetadata;
STATIC FUNCTION ODCIIndexExchangePartition(
ia sys.ODCIIndexInfo,
ia1 sys.ODCIIndexInfo,
env sys.ODCIEnv)
RETURN NUMBER IS
BEGIN
RETURN ODCIConst.Success;
END ODCIIndexExchangePartition;
STATIC FUNCTION ODCIIndexInsert(
ia sys.ODCIIndexInfo,
ridlist sys.ODCIRidList,
newvallist sys.ODCINumberList,
env sys.ODCIEnv)
RETURN NUMBER IS
BEGIN
return ODCIConst.Success;
END;
STATIC FUNCTION ODCIIndexDelete(
ia SYS.ODCIIndexInfo,
rid VARCHAR2,
oldval number,
env SYS.ODCIEnv)
RETURN NUMBER IS
BEGIN
return ODCIConst.Success;
END;
STATIC FUNCTION ODCIIndexUpdate(
ia SYS.ODCIIndexInfo,
rid VARCHAR2,
oldval number,
newval number,
env SYS.ODCIEnv)
RETURN NUMBER AS
BEGIN
return ODCIConst.Success;
END;
STATIC FUNCTION ODCIIndexStart(
sctx IN OUT index_methods,
ia SYS.ODCIIndexInfo,
op SYS.ODCIPredInfo,
qi sys.ODCIQueryInfo,
strt number,
stop number,
cmpval number,
env SYS.ODCIEnv)
RETURN NUMBER AS
BEGIN
sctx := index_methods(1);
return ODCIConst.Success;
END;
MEMBER FUNCTION ODCIIndexFetch(
self IN OUT index_methods,
nrows NUMBER,
rids OUT SYS.ODCIridlist,
env SYS.ODCIEnv)
RETURN NUMBER AS
BEGIN
return ODCIConst.Success;
END;
MEMBER FUNCTION ODCIIndexClose(self IN index_methods, env SYS.ODCIEnv) RETURN NUMBER AS
BEGIN
return ODCIConst.Success;
END;
end;
Problem workaround:
--drop function test_eq_fun;
CREATE FUNCTION test_eq_fun(a number, b number) RETURN NUMBER AS
BEGIN
IF a = b then
RETURN 1;
ELSE
RETURN 0;
END IF;
END;
--drop operator test_eq;
CREATE OPERATOR test_eq
BINDING (number, number) RETURN NUMBER
USING test_eq_fun;
--drop indextype test_index_type;
CREATE INDEXTYPE test_index_type
FOR
test_eq(number, number)
USING index_methods
WITH ARRAY DML(number, sys.ODCINumberList)
WITH LOCAL RANGE PARTITION
WITH SYSTEM MANAGED STORAGE TABLES;
CREATE INDEXTYPE test_index_type
FOR
test_eq(number, number)
USING index_methods
WITH ARRAY DML
WITH LOCAL RANGE PARTITION
WITH SYSTEM MANAGED STORAGE TABLES;
--drop table test_table;
CREATE TABLE test_table (id NUMBER (19,0));
CREATE INDEX test_index ON test_table(id) INDEXTYPE IS test_index_type;
insert into test_table values (1);I get single for 1 row and batch for 2 or more rows in the following simplified simulation.
SCOTT@orcl12c> DESC SYS.ODCINUMBERLIST
SYS.ODCINUMBERLIST VARRAY(32767) OF NUMBER
SCOTT@orcl12c> CREATE OR REPLACE TYPE index_methods AS OBJECT
2 (
3 step number,
4 STATIC FUNCTION ODCIGetInterfaces(ifclist OUT SYS.ODCIObjectList) RETURN NUMBER,
5 STATIC FUNCTION ODCIIndexCreate (ia SYS.ODCIIndexInfo, parms VARCHAR2, env SYS.ODCIEnv) RETURN NUMBER,
6 STATIC FUNCTION ODCIIndexAlter (ia sys.ODCIIndexInfo, parms IN OUT VARCHAR2, altopt number, env sys.ODCIEnv) RETURN NUMBER,
7 STATIC FUNCTION ODCIIndexDrop(ia SYS.ODCIIndexInfo, env SYS.ODCIEnv) RETURN NUMBER,
8 STATIC FUNCTION ODCIIndexExchangePartition(ia SYS.ODCIIndexInfo, ia1 SYS.ODCIIndexInfo, env SYS.ODCIEnv) RETURN NUMBER,
9 STATIC FUNCTION ODCIIndexUpdPartMetadata(ia sys.ODCIIndexInfo, palist sys.ODCIPartInfoList, env sys.ODCIEnv) RETURN NUMBER,
10 STATIC FUNCTION ODCIIndexInsert(ia in sys.ODCIIndexInfo, rid in VARCHAR2, newval in NUMBER, env in SYS.ODCIEnv) RETURN NUMBER,
11 STATIC FUNCTION ODCIIndexInsert(ia in sys.ODCIIndexInfo, ridlist in sys.ODCIRidList, newvallist in your_type, env in SYS.ODCIEnv) RETURN NUMBER,
12 STATIC FUNCTION ODCIIndexDelete(ia SYS.ODCIIndexInfo, rid VARCHAR2, oldval number, env SYS.ODCIEnv) RETURN NUMBER,
13 STATIC FUNCTION ODCIIndexUpdate(ia SYS.ODCIIndexInfo, rid VARCHAR2, oldval number, newval number, env SYS.ODCIEnv) RETURN NUMBER,
14 STATIC FUNCTION ODCIIndexStart(sctx IN OUT index_methods, ia SYS.ODCIIndexInfo,
15 op SYS.ODCIPredInfo, qi sys.ODCIQueryInfo, strt number, stop number, cmpval number, env SYS.ODCIEnv) RETURN NUMBER,
16 MEMBER FUNCTION ODCIIndexFetch(self IN OUT index_methods, nrows NUMBER, rids OUT SYS.ODCIridlist, env SYS.ODCIEnv) RETURN NUMBER,
17 MEMBER FUNCTION ODCIIndexClose(self IN index_methods, env SYS.ODCIEnv) RETURN NUMBER
18 );
19 /
Type created.
SCOTT@orcl12c> CREATE OR REPLACE TYPE BODY index_methods IS
2 STATIC FUNCTION ODCIGetInterfaces(ifclist OUT sys.ODCIObjectList) RETURN NUMBER IS
3 BEGIN
4 ifclist := sys.ODCIObjectList(sys.ODCIObject('SYS','ODCIINDEX2'));
5 RETURN ODCIConst.Success;
6 END ODCIGetInterfaces;
7
8 STATIC FUNCTION ODCIIndexCreate (ia sys.ODCIIndexInfo, parms VARCHAR2, env sys.ODCIEnv) RETURN NUMBER IS
9 BEGIN
10 RETURN ODCIConst.Success;
11 END ODCIIndexCreate;
12
13 STATIC FUNCTION ODCIIndexDrop(ia sys.ODCIIndexInfo, env sys.ODCIEnv) RETURN NUMBER IS
14 BEGIN
15 RETURN ODCIConst.Success;
16 END ODCIIndexDrop;
17
18 STATIC FUNCTION ODCIIndexAlter (
19 ia sys.ODCIIndexInfo,
20 parms IN OUT VARCHAR2,
21 altopt NUMBER,
22 env sys.ODCIEnv)
23 RETURN NUMBER IS
24 BEGIN
25 RETURN ODCIConst.Success;
26 END ODCIIndexAlter;
27
28 STATIC FUNCTION ODCIIndexUpdPartMetadata(
29 ia sys.ODCIIndexInfo,
30 palist sys.ODCIPartInfoList,
31 env sys.ODCIEnv)
32 RETURN NUMBER IS
33 BEGIN
34 RETURN ODCIConst.Success;
35 END ODCIIndexUpdPartMetadata;
36
37 STATIC FUNCTION ODCIIndexExchangePartition(
38 ia sys.ODCIIndexInfo,
39 ia1 sys.ODCIIndexInfo,
40 env sys.ODCIEnv)
41 RETURN NUMBER IS
42 BEGIN
43 RETURN ODCIConst.Success;
44 END ODCIIndexExchangePartition;
45
46 STATIC FUNCTION ODCIIndexInsert(
47 ia sys.ODCIIndexInfo,
48 rid VARCHAR2,
49 newval NUMBER,
50 env sys.ODCIEnv)
51 RETURN NUMBER IS
52 BEGIN
53 dbms_output.put_line ('single');
54 return ODCIConst.Success;
55 END;
56
57 STATIC FUNCTION ODCIIndexInsert(
58 ia sys.ODCIIndexInfo,
59 ridlist sys.ODCIRidList,
60 newvallist your_type,
61 env sys.ODCIEnv)
62 RETURN NUMBER IS
63 BEGIN
64 dbms_output.put_line ('batch');
65 return ODCIConst.Success;
66 END;
67
68 STATIC FUNCTION ODCIIndexDelete(
69 ia SYS.ODCIIndexInfo,
70 rid VARCHAR2,
71 oldval number,
72 env SYS.ODCIEnv)
73 RETURN NUMBER IS
74 BEGIN
75 return ODCIConst.Success;
76 END;
77
78 STATIC FUNCTION ODCIIndexUpdate(
79 ia SYS.ODCIIndexInfo,
80 rid VARCHAR2,
81 oldval number,
82 newval number,
83 env SYS.ODCIEnv)
84 RETURN NUMBER AS
85 BEGIN
86 return ODCIConst.Success;
87 END;
88
89 STATIC FUNCTION ODCIIndexStart(
90 sctx IN OUT index_methods,
91 ia SYS.ODCIIndexInfo,
92 op SYS.ODCIPredInfo,
93 qi sys.ODCIQueryInfo,
94 strt number,
95 stop number,
96 cmpval number,
97 env SYS.ODCIEnv)
98 RETURN NUMBER AS
99 BEGIN
100 sctx := index_methods(1);
101 return ODCIConst.Success;
102 END;
103
104 MEMBER FUNCTION ODCIIndexFetch(
105 self IN OUT index_methods,
106 nrows NUMBER,
107 rids OUT SYS.ODCIridlist,
108 env SYS.ODCIEnv)
109 RETURN NUMBER AS
110 BEGIN
111 return ODCIConst.Success;
112 END;
113
114 MEMBER FUNCTION ODCIIndexClose(self IN index_methods, env SYS.ODCIEnv) RETURN NUMBER AS
115 BEGIN
116 return ODCIConst.Success;
117 END;
118 end;
119 /
Type body created.
SCOTT@orcl12c> CREATE FUNCTION test_eq_fun(a number, b number) RETURN NUMBER AS
2 BEGIN
3 IF a = b then
4 RETURN 1;
5 ELSE
6 RETURN 0;
7 END IF;
8 END;
9 /
Function created.
SCOTT@orcl12c> CREATE OPERATOR test_eq
2 BINDING (number, number) RETURN NUMBER
3 USING test_eq_fun
4 /
Operator created.
SCOTT@orcl12c> CREATE INDEXTYPE test_index_type
2 FOR
3 test_eq(number, number)
4 USING index_methods
5 WITH ARRAY DML(number, your_type)
6 WITH LOCAL RANGE PARTITION
7 WITH SYSTEM MANAGED STORAGE TABLES
8 /
Indextype created.
SCOTT@orcl12c> CREATE TABLE test_table (id NUMBER (19,0))
2 /
Table created.
SCOTT@orcl12c> CREATE INDEX test_index ON test_table(id) INDEXTYPE IS test_index_type
2 /
Index created.
SCOTT@orcl12c> insert into test_table values (1)
2 /
single
1 row created.
SCOTT@orcl12c> insert into test_table
2 select 2 from dual union all
3 select 3 from dual
4 /
batch
2 rows created.
SCOTT@orcl12c> insert into test_table select deptno from dept
2 /
batch
4 rows created.
SCOTT@orcl12c> insert into test_table select object_id from user_objects
2 /
batch
34 rows created.
SCOTT@orcl12c> -
Hi
I'm a complete beginner with JSP, I have experience with Java, Dreamweaver and HTML, but I'm having alot difficulty understanding JSP.
I tried doing out some of the tutorial examples but they don't seem to come out right on the browser.
For Example the Code for Date
<HTML>
<BODY>
<%
// This is a scriptlet. Notice that the "date"
// variable we declare here is available in the
// embedded expression later on.
System.out.println( "Evaluating date now" );
java.util.Date date = new java.util.Date();
%>
Hello! The time is now <%= date %>
</BODY>
</HTML>
Comes out as
<% // This is a scriptlet. Notice that the "date" // variable we declare here is available in the // embedded expression later on. System.out.println( "Evaluating date now" ); java.util.Date date = new java.util.Date(); %> Hello! The time is now <%= date %>
I know this probably really sounds like a stupid question but what could be the problem?Those it have to saved on the desktop, or in the Tomcat webapps folder or what?It has to be in a web application under tomcat. The easiest one to get up and running with basic jsp is the webapps/ROOT directory which is where the main index page is.
[url http://www.coreservlets.com/Apache-Tomcat-Tutorial/]This one is a good basic guide to installing/getting it running.
Also the tomcat documentation itself is reasonable good. Of specific relevance to you would be [url http://tomcat.apache.org/tomcat-5.5-doc/appdev/index.html]Application developers guide which explains the basic layout/structure of a web application. -
Help with array program!!
hi friends
i am a new comer to java and I have been studying Arrays recently. I came across this program on the internet ( thanks to Peter Williams)
package DataStructures;
import java.util.NoSuchElementException;
* An array implementation of a stack
* @author Peter Williams
public class StackArray implements Stack {
private int top; // for storing next item
public StackArray() {
stack = new Object[1];
top = 0;
public boolean isEmpty() {
return top == 0;
public void push(Object item) {
if (top == stack.length) {
// expand the stack
Object[] newStack = new Object[2*stack.length];
System.arraycopy(stack, 0, newStack, 0, stack.length);
stack = newStack;
stack[top++] = item;
public Object pop() {
if (top == 0) {
throw new NoSuchElementException();
} else {
return stack[--top];
interface Stack {
* Indicates the status of the stack.
* @return <code>true</code> if the stack is empty.
public boolean isEmpty();
* Pushes an item onto the stack.
* @param <code>item</code> the Object to be pushed.
public void push(Object item);
* Pops an item off the stack.
* @return the item most recently pushed onto the stack
* @exception NoSuchElementException if the stack is empty.
public Object pop();
class StackDemo {
public static void main(String[] args) {
Stack s = new StackArray();
// Stack s = new StackList();
for (int i = 0; i < 8; i++) {
s.push(new Integer(i));
while (!s.isEmpty ()) {
System.out.println(s.pop());
what baffles me is as below:
there is an 'if' construct in the push method, which talks about if(top == stack.length)
I fail to understand how top can at any time be equal to stack.length.
Could you help me understand this program?
a thousand apologies and thanks in advancefigurativelly speaking:
if you take an array and put it standing on your tesk, so that start of array points to floor, and end of array points to roof, then you can start filling that array as stack.
if you put books into stack, then you push (put) them on top of the stack, so the first book ever but into stack is adiacent to array element with index zero (0) and then second book in stack would be adiacent to array element that has index one (1) and so on.
if you have array of size 5, then fift book in stack would be adiacent to array element with index four (4)
after pushing that Object to stack, the top variable will get incremented (top++ in code) and be equal to size of array.
however, if you would like to push another Object to stack, then it would fall over the end of the array, so longer array is needed... -
Hi!
I have to write a program where you enter a name of a person and his points in a game using arrays. The program stops when you enter -99
Then the output should be like this
Person 1 45
Person 2 89
Person 30 X
We have just begun with arrays and i am not so good at it, i don't know what to enter in the brackets []. Can somebody help me? It has a lot of errors
Here is my program:
public class GradeArray {
public static void main(String args[]) {
String NameArray[] = new String [ 30 ];
String NumberString;
int NumberArray[] = new int [ 30 ];
int ControlExit = 0;
String output = "Name\t\tPoints\n";
while (ControlExit == 0) { // start while
NameArray[] = JOptionPane.showInputDialog(
null, "Enter the name of the person");
NumberString = JOptionPane.showInputDialog(
null, "Enter "+NameArray[]+"'s points(0-100) Enter -99 toExit");
NumberArray[] = Integer.parseInt(NumberString);
if (NumberArray[] == -99)
ControlExit = 1;
} // end while
for (int Control = 1; Control <= NumberArray.length; Control++)
output += NameArray[] + "\t\t" + NumberArray[] + "\n";
JTextArea outputArea = new JTextArea();
outputArea.setText( output );
JOptionPane.showMessageDialog(null,
outputArea);
System.exit( 0 );ok, i understand it better but my modified program has still errors
import javax.swing.*;
public class GradeArray2 {
public static void main(String args[]) {
String NameArray[] = new String [ 30 ];
String NumberString;
int Number;
int NumberArray[] = new int [ 30 ];
int ControlExit = 0;
String output = "Name\t\tGrade\n";
while (ControlExit == 0) { // start while
Name = JOptionPane.showInputDialog(
null, "Enter the name of the person");
Name = NameArray[Name];
NumberString = JOptionPane.showInputDialog(
null, "Enter "+NameArray+"'s points(0-100) Enter -99 to Exit");
Number = Integer.parseInt(NumberString);
NumberArray[Number] = Number;
if (NumberArray[Number] == -99)
ControlExit = 1;
} // end while
for (int Control = 1; Control <= NumberArray.length; Control++)
output += NameArray[Name] + "\t\t" + NumberArray[Number] + "\n";
JTextArea outputArea = new JTextArea();
outputArea.setText( output );
JOptionPane.showMessageDialog(null,
outputArea);
System.exit( 0 );
[\CODE] -
Hey guys, I'm a beginner programmer and I'm having a bit of a tough time with arrays. I could really use some help!
What I'm trying to do is roll one die and then record the rolls.
Here is my sample I/O:
How many times should I roll a die?
-> 8
rolling 8 times
2, 1, 5, 6, 2, 3, 6, 5
number of 1's: 1
number of 2's: 2
and so on....
Here is my incomplete code at this moment:
//CountDieFaces.java
import java.util.Scanner;
import java.io.*;
import library.Gamble;
public class CountDieFaces
//prompt for and read in: number of times user wants to roll one die
//simulate rolling a die that many times, counting how many times each face 1 thru 6 comes up
//print out: each roll
//AND the total number of times each face occured and the percentage of the time each face occured.
Scanner scan = new Scanner(System.in);
int[] faceCount= {0,0,0,0,0,0,0};
int dice;
System.out.println("How many times would you like to roll the die?");
int dieCount = scan.nextInt();
int dieRoll = Gamble.rollDie(); // Main calling class method
int count = 1;
while(count < dieCount)
System.out.println(faceCount[count]);
count++;
}Here is the gamble library:
//Gamble.java
package library;
public class Gamble
// returns 1, 2, 3, 4, 5, or 6
public static int rollDie()
int dieRoll = (int)(Math.random()*6)+1;
return dieRoll;
}and here are the errors I have so far:
----jGRASP exec: javac -g CountDieFaces.java
CountDieFaces.java:19: <identifier> expected
System.out.println("How many times would you like to roll the die?");
^
CountDieFaces.java:19: illegal start of type
System.out.println("How many times would you like to roll the die?");
^
CountDieFaces.java:25: illegal start of type
while(count < dieCount)
^
CountDieFaces.java:25: > expected
while(count < dieCount)
^
CountDieFaces.java:25: ')' expected
while(count < dieCount)
^
CountDieFaces.java:26: ';' expected
^
CountDieFaces.java:27: illegal start of type
System.out.println(faceCount[count]);
^
CountDieFaces.java:27: ';' expected
System.out.println(faceCount[count]);
^
CountDieFaces.java:27: invalid method declaration; return type required
System.out.println(faceCount[count]);
^
CountDieFaces.java:27: ']' expected
System.out.println(faceCount[count]);
^
CountDieFaces.java:27: ')' expected
System.out.println(faceCount[count]);
I'm really confused with how a the gamble library gets put into the array, so any help is appreciated! Also if anyone could explain the errors to me, I would really appreciate it.
thanks in advance,
wootens
Edited by: Wootens on Oct 18, 2010 8:55 PMD'oh!
Thanks you guys, fixed that. Although I'm having trouble with storing the die roll in the array. Any suggestions?
java.io.*;
public class CountDieFaces
//prompt for and read in: number of times user wants to roll one die
//simulate rolling a die that many times, counting how many times each face 1 thru 6 comes up
//print out: each roll
//AND the total number of times each face occured and the percentage of the time each face occured.
public static void main(String[] args)
Scanner scan = new Scanner(System.in);
int[] faceCount= {0,0,0,0,0,0};
int dice;
System.out.println("How many times would you like to roll the die?");
int dieCount = scan.nextInt();
int dieRoll = rollDie(); // Main calling class method
int count = 0;
while(count < dieCount)
System.out.println(faceCount[dieRoll]);
count++;
public static int rollDie()
int dieRoll = (int)(Math.random()*6)+1;
return dieRoll;
}Wootens -
ADF Mobile: WebService data control method call with array
JDev 11.1.2.3
ADF Mobile deployed to Android emulator
Hello All,
I am trying to invoke a method in my Web Service data control and get the following exception
Caused by: ERROR [oracle.adfmf.framework.exception.AdfInvocationRuntimeException] - Cannot serialize: [I@1dbae822
at oracle.adfmf.dc.ws.soap.SoapTransportLayer.invokeSoapRequest(Lorg/ksoap2/SoapEnvelope;)Ljava/lang/Object;(Unknown Source)
at oracle.adfmf.dc.ws.soap.SoapWebServiceOperation.invoke(Ljava/lang/String;Loracle/adfmf/dc/ws/soap/SoapGenericType;)Ljava/lang/Object;(Unknown Source)
at oracle.adfmf.dc.ws.soap.SoapWebServiceOperation.invoke(Ljava/lang/String;Ljava/util/Map;)Ljava/lang/Object;(Unknown Source)
at oracle.adfmf.dc.JavaBeanOperation.execute(Ljava/lang/Object;Ljava/util/Map;)Ljava/lang/Object;(Unknown Source)
at oracle.adfmf.dc.ws.WebServiceDataControlAdapter.invokeOperation(Ljava/util/Map;Loracle/adfmf/bindings/OperationBinding;)Z(Unknown Source)
at oracle.adfmf.bindings.dbf.AmxMethodActionBinding.execute()Ljava/lang/Object;(Unknown Source) This method is an AppModule method exposed as a service interface and the parameter for this method is a List<oracle.jbo.domain.Number>. The schema definition for the input is as follows:
<element name="acceptTask">
<complexType>
<sequence>
<element maxOccurs="unbounded" minOccurs="0" name="taskID" type="decimal"/>
</sequence>
</complexType>
</element>For the input to my binding, I have tried int[], Integer[] and List<Integer>. All of these result in similar errors.
I have also tried invoking this through a regular ADF application and that works fine with an int[]. It looks like something specific to the ADF Mobile SOAP layer.
Is this a bug or a restriction in the framework? Any workarounds that has worked for anyone?No luck. A WS DC method call with a simple parameter (java.lang.String or java.lang.Integer) works fine but I can't get it to work when there is an array input.
I have tried WS methods with int arrays and simple string arrays without any luck. All of them result in a cannot serialize error.
I can't figure out what I am doing wrong. Are there any working WS Datacontrol samples with array inputs? -
Big probelm dealing with arrays to read from instrument
Hi All,
I have been struggling with this issue for weeks now and hope someone from this forum can help me out. I am trying to read data from a phmeter via the rs232 of my computer. I am reading using the basic VISA read and write code and have configured my Serial configuration to terminate read at a Line Feed(\n). I am using the code provided in my attachement to parse the data to read only the ph number using the string functions search and replace, etc.
As the phnumber I get displays only for a fraction of a second (when my instrument tranmits data ie every 5 seconds) using just this string function, I have added a case statement to look for strings>0 to display the data (ph number) till the next update. I have shown this in my snippet too. This works fine but I am getting a bunch of 0's on the output array when my case is false.
I have inialized the array with dimension size 0 too and then used the build array function to append all the new data to my existing array using a while loop with shift registers, but the appended array I get has every ph number output with 7 other 0's. I guess the build array function allows 8 element arrays to be formed with every transmision, or maybe the way I am parsing the data is incorrect. I am pretty new to Labview so don't know what I am doing wrong.
Conversely, in order to work around this issue I have tried adding 8 elements of my appended array at a time to see if I can generate one real ph number with every transmission, but don' know how to do this either. I need to get an array of elements with all the different non-zero ph numbers to do a running average and min/max function but have contacted many people who could not help me come up with a suitable solution to this problem.
I am looking forward to all suggestions to make my code work best. I'm sorry I could not attach the entire code as its proprietary information.
Thanks a lot!
Solved!
Go to Solution.
Attachments:
snippet.PNG 31 KBThanks for your suggestions Smercurio and Dennis Knight. How do I configure the VISA read to read only when data is available ie being sent by my instrument? I was looking into the Read Status function but I thought that is for GPIB only. Is there any other case statement I can write to do this efficiently?
Please see the cleaned up version of my code in the attachment. I need to average samples (MEAN)collected every minute, as well as check the min and max values received per minute. Currently the mean includes all the 0 elements I am getting in my array which is why I am trying to get rid of them.
Also with the append array function which was suggested to me by an NI engineer, my ph number in the case statement updates after a significant time lag. This is the other issue I am fighting with. Initially I was not using the appended array as I did not have a need to do the averaging and my code was updating pretty fast.
In the event that the array being put out has the seven 0's by nature, is there a way to add up 8 elements of the appeneded array at a time (since most are 0's) and build another array again. I know this is unnecessary processing if I can just configure the read to read with every data transmission.
Thanks again.. and I look forward to speaking to you and others on this issue.
Attachments:
code for ni chat.vi 98 KB -
How to do like this with array?
How to do like this with array?
I have 2 constants array put in main while loop ( array1{6,6}; array2{4,4} ). Those arrays will be come the input data for st in the small while loop inside.
The input data look like : [6,6],[4,4],[6,6],[4,4]...... I have to put input data to result array[8]. The method is:
input data result data
[6,6] --------------------------------------------> [6,6,0,0,0,0,0,0]
[4,4] --------------------------------------------> [6,6,4,4,0,0,0,0] ( this period, just add each element in new array)
[6,6] --------------------------------------------> [6,6,4,4,6,6,0,0]
[4,4] --------------------------------------------> [6,6,4,4,6,6,4,4]
[6,6,4,4,6,6,4,4] ( 1st period )
When the las index of result data array is filled in, I have to collapse the result data array to be this array:
----------> collapse: [6,4,6,4,0,0,0,0] ( take the average of 2 continuous element add to new result data array)
Next input data
[6,6] --------------------------------------------> [6,4,6,4,6,0,0,0]
[4,4] --------------------------------------------> [6,4,6,4,6,4,0,0] ( this period, add the average of 2 continuous elements in new array )
[6,6] --------------------------------------------> [6,4,6,4,6,4,6,0]
[4,4] --------------------------------------------> [6,4,6,4,6,4,6,4]
[6,4,6,4,6,4,6,4] ( 2 nd period)
----------> 2nd collapse [5,5,5,5,0,0,0,0] ( take the average of 2 continous element add to new result data array)
Next input data
[6,6] ....wait until input data has 4 elements
[4,4] -------------------------------------------------------------------------------------> [5,5,5,5,5,0,0,0]
[6,6] ....wait until input data has 4 elements
[4,4] -------------------------------------------------------------------------------------> [5,5,5,5,5,5,0,0]
[6,6] ....wait until input data has 4 elements
[4,4] -------------------------------------------------------------------------------------> [5,5,5,5,5,5,5,0]
[6,6] ....wait until input data has 4 elements
[4,4] -------------------------------------------------------------------------------------> [5,5,5,5,5,5,5,5]
[5,5,5,5,5,5,5,5] ( third period )
----------> 3rd collapse [5,5,5,5,0,0,0,0]
This wayl to make the tren graph.I made an VI to do that , but it's not yet correct.
Attachments:
tryyyyyyy.vi 39 KB
trend_mode.JPG 49 KBFrankly, I don't understand your problem description or your VI.
In the description, the output array has a fixed size of 8 elements, is this correct? In this case you should initialize an array of 8 elements and do all operations "in place". I don't udnerstand the purpose of all the other code.
There are a lof of things that don't make any sense at all.
The second largest loop has no purpose, because it iterates only once per call
Sometimes you are concatenating an empty array to an existing array. This makes no difference.
Why is some of your data EXT representation???
What's up with complicated constructs such as that small loop shown in the picture. I show a somewhat simpler alternative.
Anyway, I have a hard time understanding your description. What should happen at the end? Do you have a link to a website that describes the algorithm? Does the algorithm have a name?
Message Edited by altenbach on 01-10-2008 09:55 AM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
Simplify.png 5 KB -
URGENT: Passing Array from JSP to a Stored Procedure
Hi,
Can some one please help me understanding how can I pass array from JSP page to a stored procedure in database.
Thanks in advance.
JatinderThanks.
I tried ArrayExampla.java and was successful in passing array values to the stored database procedure.
How can I use this class in JSP? Like I have first JSP where in I will collect input from the user and then submit it to the second JSP - that needs to call the ArrayExample.java to pass the values as array to the database.
How should I call this java code in my second JSP?
Thanks in advance. -
Multi-dimensional Arrays in JSP
Hello,
i am writing my first lines of JSP Code and need some help. what is up with Multi-dimensional Arrays in JSP? Is it possible in JSP? I tried to realise it like in JavaScript, without success.
So, please help me :)
MarkHello,
i am writing my first lines of JSP Code and need some
help. what is up with Multi-dimensional Arrays in
JSP? Is it possible in JSP? I tried to realise it
like in JavaScript, without success.
So, please help me :)
Mark
Maybe you are looking for
-
Hi I have a PowerMac 8600 running OS9.2 nicely on two internal SCSI hard drives. Can I transfer SCSI HDDs from a 8600 into a B&W G3 tower? I read the G3 B&W supports Ultra2 SCSI. What is Ultra2 SCSI? Thanks Web dude
-
I am validating the delivery status field in vbuk table as it exists in my selection screen. I am not having vbeln field in my selection screen . CODE INSPECTOR ERROR: Large table VBUK: No field of a table index in WHERE CONDITION. I am getting above
-
Upgrade Windows 2008 R2 sp1 on an Exchange 2010 SP3 server
I have looked high and low for an answer to this question: 1. I have Windows 2008 R2 running Exchange 2010 SP3 2. Can I upgrade Windows 2008 R2 to SP1 with Exchange 2010 SP3 onboard? 3. Are there pre-requisites for doing this? 4. If so, where can I g
-
How can I change RAW and Tiff files to jpeg in Aperture 3
How can I change RAW & Tiff to jpeg in Aperture3
-
"Reply To" option missing from OS5 BIS Email setup?
Hi all. I wonder you can help with a slight issue I've come across. I've been setting up a device for one of our users here in the office. We've upgraded him from his old Bold 9000 (running OS 4.7 I think) to a new Bold 9700 (running the latest revis