Krikor Krumlian

Greenhorn
+ Follow
since Sep 24, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Krikor Krumlian

Hello Guys,

A quick question I am a first time test taker. I do have the Appointment summary in my hand but there is nothing that says Test Site Code , or anything like that.

All i have is Test Site , Test Site Address , Test Site Phone
Test Site : NEW HORIZONS - is this it

thank you
18 years ago
I found the following definitions on javaranch

An Association is a channel between classes through which messages can be send. As sending messages translates to calling methods in Java, Associations are typically (but not necessarily) implemented by references.
An Aggregation is an Association which denotes an "is part of" relationship. Unfortunately, the definition of this relationship is quite lax, so basically everyone is using his own interpretation. The only definitive (?) property is that in an instance graph, aggregations are not allowed to be circular - that is, an object can not be "a part of itself".

A Composition adds a lifetime responsibility to Aggregation. In a garbage collected language like Java it basically means that the whole has the responsibility of preventing the garbage collector to prematurely collect the part - for example by holding a reference to it. (In a language like C++, where you need to explicitely destroy objects, Composition is a much more important concept.) Only one whole at a time can have a composition relation ship to a part, but that relationship doesn't need to last for the whole lifetime of the objects - with other words, lifetime responsibility can be handed around.

Can anybody give me concrete java code examples on what the difference between the two are.
Composition in some books is described as a has-a relation ship but then what's association ?


Thank you
18 years ago
THanks you nicholas for your answers.

As to the name issue, that required two different messages ; I didn't
change my name because i wanted to violate your naming rule ; Changed
it back to what it was


Krikor
18 years ago
Hey guys,

Just registered for the SCJA , just making sure here , but whoever passes the beta exam
will recieve a certificate right ?

In section 1 , 1.1 enumeration types these are the ones introduced in Java 5 right .

Thank you
KK
[ June 02, 2005: Message edited by: KK ]
18 years ago
Well i don't thin the name is the problem cause i was able to do the following ,

CallableStatement cs = con.prepareCall("{ call ? := content_item.new(?,?) }");
cs.registerOutParameter(1, java.sql.Types.INTEGER);
cs.setString(2,"kb"); //name
cs.setInt(3, 982); //parent_id
This worked Fine but if i do this

CallableStatement cs = con.prepareCall("{ call ? := content_item.new(?,?,?) }");
cs.registerOutParameter(1, java.sql.Types.INTEGER);
cs.setString(2,"kb"); //name
cs.setInt(3, 982); //parent_id
cs.setNull(4,java.sql.Types.INTEGER); // item_id

Then it complains saying that i cannot input a null , and i don't really want to
input any number myself cause that is being generated by the function i think
cause the return value is exaclty the same .

So my question what should i input into this parameter , where it's declared as an IN
it's autopopulated by the function ? How can i view the code of the funtion which is in a
package by the way .

thank you all again
Hello all ,

I have the following pl/sql function

FUNCTION NEW RETURNS NUMBER(38)
Argument Name Type In/Out Default?
------------------------------ ----------------------- ------ --------
NAME VARCHAR2 IN
PARENT_ID NUMBER(38) IN DEFAULT
ITEM_ID NUMBER(38) IN DEFAULT
LOCALE VARCHAR2 IN DEFAULT
CREATION_DATE DATE IN DEFAULT
CREATION_USER NUMBER(38) IN DEFAULT
CONTEXT_ID NUMBER(38) IN DEFAULT
CREATION_IP VARCHAR2 IN DEFAULT
ITEM_SUBTYPE VARCHAR2 IN DEFAULT
CONTENT_TYPE VARCHAR2 IN DEFAULT
TITLE VARCHAR2 IN DEFAULT
DESCRIPTION VARCHAR2 IN DEFAULT
MIME_TYPE VARCHAR2 IN DEFAULT
NLS_LANGUAGE VARCHAR2 IN DEFAULT
TEXT VARCHAR2 IN DEFAULT
DATA BLOB IN DEFAULT
RELATION_TAG VARCHAR2 IN DEFAULT
IS_LIVE CHAR IN DEFAULT


Now when i want to trigger this function i use the following code in
sqlplus

SQL> variable answer number;
SQL> execute :answer := content_item.new (name => 'k',title => 'k is here', parent_id => 982, description => 'yahoo', content_type => 'wg_tv_program', is_live => 'Y', creation_user => 44, creation_ip => '222' );

As you can see i don't use all argument names . And this works fine

But to do this through jdbc i have the following code

CallableStatement cs = con.prepareCall("{ ? = call content_item.new(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ,?) } ");
cs.registerOutParameter(1, java.sql.Types.INTEGER);
cs.setString(2,"k"); //name
cs.setInt(3, 982); //parent_id
cs.setInt(4,0); //item_id ??
cs.setString(5,"mm"); //locale
cs.setDate(6,null); // Creation_date
cs.setInt(7,44); //Creation User
cs.setInt(8,0); // Context_ID
cs.setString(9,"222"); //creation_ip
cs.setString(10,"nn"); // Item_subtype
cs.setString(11,"wg_tv_program"); //content_Type
cs.setString(12,"Krikor"); //title
cs.setString(13,"hehe"); //description
cs.setString(14,"bb"); // mime_Type
cs.setString(15,"oo"); // nls_type
cs.setString(16,"tt"); // text
cs.setString(17,"ff");
cs.setString(18,"dd");
cs.setString(19,"Y"); //IS_LIVE

cs.execute();
logger.debug("WHAT DO WE HAVE HERE" + cs.getInt(1));

So when the following code is called , i get the following

<Couldn't create Program : ORA-06550: line 1, column 13:
PLS-00306: wrong number or types of arguments in call to 'NEW'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
>

And i cannot figure out what i am doing wrong ?
Also is there a way to use the argument names so i won't have to use all the arguments.? how can i use the default values ? tried to set some of the values to null but that threw an error saying i can't input errors ?

Sorry for the Mass questions
Thank you all
Hello everyone ,

using maven 1.0.2
and junit 3.8.1
machine MAC OSX

So i am building this project using maven and i have a unit test that i'm trying
to get it to work in maven but so far no luck

my project.xml has this junit dependency defined and nothing else

<!-- Junit for my unit testing -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<type>jar</type>
<properties><war.bundle>false</war.bundle></properties>
</dependency>

as to the build part it goes as follows

<build>

<nagEmailAddress>krikor_krumlian@wgbh.org</nagEmailAddress>

<sourceDirectory>src</sourceDirectory>
<unitTestSourceDirectory>src/test</unitTestSourceDirectory>


<!-- Unit test cases -->
<unitTest>
<includes>
<include>**/*Test*.java</include>
</includes>
</unitTest>

</build>

So now building my app using the command maven test:test
gives me the following

__ __
| \/ |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \ ~ intelligent projects ~
|_| |_\__,_|\_/\___|_||_| v. 1.0.2

build:start:

java repare-filesystem:

java:compile:
[echo] Compiling to /Users/greg/Documents/sprnghibapp/target/classes

java:jar-resources:

test repare-filesystem:

test:test-resources:

test:compile:
[javac] Compiling 1 source files to /Users/greg/Documents/sprnghibapp/target/test-classes

test:test:
[junit] Running KkTest
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
[junit] Testsuite: KkTest
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
[junit]
[junit] Null Test: Caused an ERROR
[junit] KkTest
[junit] java.lang.ClassNotFoundException: KkTest
[junit] at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
[junit] at java.security.AccessController.doPrivileged(Native Method)
[junit] at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
[junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
[junit] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
[junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
[junit] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
[junit] at java.lang.Class.forName0(Native Method)
[junit] at java.lang.Class.forName(Class.java:141)
[junit]

Does anybody know what this is and what the problem is ?
As you realized the test source files are compiling and are being
copied to the target/test-classes which should happen and after that
i get this null thing Any thoughts

Thank you
19 years ago
Hello All
I'm using validation.xml to validate some properties in beans so to do a simple validate we do :

<form name="someForm">
<field property="knumber" depends="required">
<arg0 key="someForm.knumber.label"/>
</field>
</form>

that's straight forward , Now if we have a list as one of the properties then
we do this

<field property="nestedprop" indexedListProperty="programs" depends="required">
<arg0 key="someForm.knumber.label"/>
</field>

Now that works too , The question what if we have a nested list in the above list what do we do ? Any ideas ? thank you
19 years ago