Win a copy of Spring Boot in Practice this week in the Spring forum!

Keith Wegner

Greenhorn
+ Follow
since Jan 21, 2009
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 Keith Wegner

René van der ven wrote:
Example is about
Customer(name, gender, income age, Address, getAddress, setAddress)
Address(street, city, state, country)

If I extend your example with Supplier
Where do I place the getAddress and setAdress methods.

Supplier(name, gender, income age, Address, getAddress, setAddress)
or
Address(street, city, state, country, getAddress, setAddress)



Think about this conceptually.

Does a Customer have an address? In literal terms, does he have a physical residency that something is being delivered?
Does a Supplier have an address? In literal terms, does he have a physical place of business that he sends his products from, or that a Customer sends his payment to?

The answer to both of those is Yes.

And would it make sense for an address to getAddress() or setAddress()? You're asking the class to set itself and get itself.
An Address would have methods like:

public void setStreet(String streetName){...}
public String getStreet(){...}

public void setZipCode(String zipCode){...}
public String getZipCode(){...}


12 years ago
Overall: 46/51 (90%)

Fundies of OO..........................................100
UML..........................................................83
Java Impl of OO........................................87
Algorithms................................................66
Java Dev Fundies....................................100
Java Platforms, Integration Techs...........100
Client Techs.............................................80
Server Techs...........................................100


I ran through all of the questions once in about 45 minutes, then took another 20 to review about 10-15 of them that I marked to return to.

I sort of did this exam for fun. I have about 2.5 years experience as a Java developer; mostly J2SE, although some time has been with J2EE, but it's been long enough that I had to brush up on some of those topics. I have, however, somewhat recently taken graduate courses in J2EE.

I studied for about 2 1/2 weeks, mostly reading through Cameron's Study Guide. I also used my SCJP exam book (Sierra Bates) to get a more comprehensive review of the programming portions of the exam. I took the practice exam at the end of Cameron's book, and bought the WhizLabs exams. I scored lower on all of the practice exams (lower on the WhizLabs than Cameron's), but, to be fair to myself, didn't take nearly enough time on any of them - I was more interested in seeing the question types.

WhizLabs' package also contained an 8 page Review Guide that I found had a lot of very relevant material
12 years ago
Johns Hopkins University's Engineering Programs for Professionals offers a course in Java Security. A lot of their CS courses can be taken online, and they also have a campus in Montgomery County.

I'm waiting for its next availability and will likely sign up for it.

Here are direct links the course description:
Java Security
Java Security
13 years ago
The Java books by DEITEL are readable, comprehensive (cover network programming, jdbc, xml, jsp/servlets, and other somewhat advanced java tools).

I would recommend getting their latest book and start reading through the chapters and doing some of the chapters' exercises.

Once you start getting comfortable with Java, you may want to consider spending a month or two to study for the Sun Certified Java Associate exam, which is fairly easy and, although it isn't exactly 'sought after' by employers, it will show you have some rudimentary understanding of the language and an initiative to learn more. Even later down the road, you could study and sit for the Sun Cert. Java Programmer exam, which demonstrates you know the real nuts and bolts of the fundamentals of the language. Although this isn't all related to PL/SQL per-se, you still need to understand these fundamentals.

A course I've taken in the past has some really good material to teach some of the above mentioned concepts* that are actually applicable to the job: http://web3.apl.jhu.edu/605.481/index.html

*make sure you understand that foundations of object-oriented language (inheritence, polymorphism, encapsulation, etc), basic Java syntax, and some of the fundamental classes and data structures before looking at the lecture PDF's on that site, though.

Bauke Scholtz wrote:Which is not the root cause of the problem by the way.

You said that you added the JAR file to the JAVA_HOME, which makes completely no sense. I just wanted to rectify that.


I agree that it makes no sense - I found the idea here:

http://www.stardeveloper.com/articles/display.html?article=2003090201&page=4

"Among the extracted files will be a JAR file with a name like 'mysql-connector-java-3.0.8-stable-bin.jar'. Copy this file to your %JAVA_HOME%/jre/lib/ext folder which on my system happens to be D:\j2sdk1.4.2\jre\lib\ext>.

You should also add the complete path to this JAR file in your CLASSPATH environment variable. ..."

Bauke Scholtz wrote:The JAVA_HOME environment variable should point to the root folder of the JDK.
The CLASSPATH environment variable is in fact only and only used when you execute java.exe or javac.exe without the -cp, -classpath or -jar arguments.


My JAVA_HOME is pointing there.

Jan Cumps wrote:Eclipse does not use your classpath when compiling / running your project.

from https://eclipse-tutorial.dev.java.net/eclipse-tutorial/part1.html

Right-click on the project and select "Properties". Go to the "Libraries" tab in "Java Build Path":
Click on "Add (external) JARs..." ...



I should have also mentioned that I tried adding the connector/j's bin file into my JAVA_HOME path.

I'll try this, though. Thanks.

Jan Cumps wrote:Add the Connector/J jar to your project classpath in Eclipse.



It is in the CLASSPATH already:

C:\mysql-connector-java-5.0.8\mysql-connector-java-5.0.8\mysql-connector-java-5.0.8-bin.jar;

<EDIT> Actually, I'm not sure how to add it to the project classpath. Can you explain?</EDIT>
I hate to ask such a simple question on this board, but I'm not seeing this one...

I'm running 64-bit Vista
Eclipse Version 3.4.1, installed to C:\Program Files (x86)\eclipse
Java JDK is installed to C:\jdk1.6.0_12
Connector/J is installed to C:\mysql-connector-java-5.0.8\mysql-connector-java-5.0.8

CLASSPATH=.;C:\apache-tomcat-5.5.17\common\lib\servlet-api.jar;C:\apache-tomcat-5.5.17\common\lib\jsp-api.jar;C:\Servlets+JSP;..;..\..;C:\apache-tomcat-5.5.27\apache-tomcat-5.5.27\common\lib\servlet-api.jar;C:\apache-tomcat-5.5.27\apache-tomcat-5.5.27\common\lib\jsp-api.jar;C:\Users\kwegner83\Servlets+JSP;C:\mysql-connector-java-5.0.8\mysql-connector-java-5.0.8\mysql-connector-java-5.0.8-bin.jar;C:\Users\kwegner83\workspace\

JAVA_HOME=C:\jdk1.6.0_12

Trying to run the following code displays Driver not loaded => java.lang.ClassNotFoundException: com.mysql.jdbc.Driver to the console:

import java.sql.*;
public class DBTest {
public static void main(String[] args)
{
try
{ Class.forName("com.mysql.jdbc.Driver");
}
catch(ClassNotFoundException e)
{
System.out.println("Driver not loaded => " + e);
System.exit(1);
}
}
}

What's going on here?