Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!

Jay Peigh

Greenhorn
+ Follow
since Feb 15, 2007
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 Jay Peigh

Hey all,

I was trying to find a good book to buy to learn the concepts of (and how to write) JSPs and Servlets and how they tie into the J2EE system.

I hear the "Head First JSP/Servlets" book is a pretty good one. Does anybody have any other recommendations?

Thanks in advance for the help.


Jay
15 years ago
Hi all,

Just wondering if anybody had any good resources for learning how to code JSPs, JPFs, and their relationships within an application.


thank you!

Jay
15 years ago
JSP
Thanks for the help Jeanne,

I didn't quite understand your explanation on the Date. So I can basically pass a GregorianCalendar object to a Date object?

Thanks,

JP
Hi all,

2 questions:

(1)
Just trying to test the insert method within my DAO. the method will insert mostly Strings and Integers, but a few Dates also. I checked the API for java.sql.Date, and it says to pass in a long Date. So I used a millisecond to Date converter and generated a number from a date. However, the compiler rejected the number, as it was too big.

So now, I just passed in a new GregorianCalendar(106, 11, 15).getTime() instead. Will this work?

(2)
I am a bit new to writing DAO classes, so just had a question on testing insert statements:

In order for an insert to work, do the fields in your query statement have to be in the exact same order as in the table? I am not hardcoding in values in the query, as these will come from getter methods from another class.

So, for example, i have: "INSERT INTO MYTABLE (COL1, COL2, COL3)" + "VALUES(?, ?, ?)";


Thanks in advance for any help.

Jay
Hi all,

First off, an apology to the site moderators, I posted this thread 2x (once on the JSP forum, and the Portal Section), didn't know exaclty where this topic belongs...

Can anybody recommend any good websites/book out there that will help how to code JSPs and JPFs to use within Weblogic Portal 8.1 framework?

I was going to buy the head first JSP/Servlet book, but not sure if that will give me enough help using weblogic's <netui> tags..

any help is greatly appreciated.

Jay
15 years ago
Hi all,

First off, an apology to the site moderators, I posted this thread 2x (once on the JSP forum, and the Portal Section), didn't know exaclty where this topic belongs...

Can anybody recommend any good websites/book out there that will help how to code JSPs and JPFs to use within Weblogic Portal 8.1 framework?

I was going to buy the head first JSP/Servlet book, but not sure if that will give me enough help using weblogic's <netui> tags..

any help is greatly appreciated.

Jay
15 years ago
JSP
gotcha, thanks again for the help dave!

Jay
15 years ago
i see how the concept works now dave, thank you...however, i don't see why that would make sense...if you have a setter method for the integer, why pass it in the constructor?
15 years ago
whoops..sorry Dave, i meant to say, will the value of "val" be whatever i passed into the SETTER method, and not the value of what was passed into the constructor (because they are in essence, not the same value).
15 years ago
Thanks Dave for the examples..I think the last one cleared things up...

so for your last code example:

public class MyInteger
{
private int val;

public MyInteger(int val)
{
this.val=val;
}
public void setValue(int val)
{
this.val=val;
}
public int getValue()
{
return val;
} ...


Will the getter be returning whatever value "val" is that was passed into the method?
15 years ago

But in the above scenario we are passing the exact same object to both.



Actually, even though i am passing the same object type and name in my method and data members, it doesn't mean that it's the same object. I think (Shadowing)?

I just don't understand how this makes sense. Why would you want to add more than of the same object type in a method within a class who's constructor already gets it passed in?

Thanks,

Jay
15 years ago

The only thing that can be inferred by your code is that the arguments of the methods are the same type as the arguments in the constructor.



Dave, so are you saying that it doesn't make sense to have the same TYPE within the constructor and it's methods?

Thanks,

Jay
15 years ago
Hi all,

Just wanted to say really great site..just a quick (and possibly dumb) question. Take the following code snippet;

public class MyClass
{
private SomeObject o;
private AnotherObject a;
private List list;

public MyClass(SomeObject o, AnotherObject a)
{
this.o = o;
this.a = a;
}

public void addSomething(SomeObject o)
{
list.add(o);
}

public void addAnotherThing(AnotherObject a)
{
list.add(a)
}

You will notice that i'm passing in the same objects in the 2 methods as the ones that are passed in my constructor. Does this make sense to do this? Are the Objects passed in my constructor the same as the ones passed in my methods?

Thanks in advance,


Jay
15 years ago