Help coderanch get a
new server
by contributing to the fundraiser

RajivAwadhesh kumar

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

Recent posts by RajivAwadhesh kumar

This example is there on page 365 of headfirst java. Its a swing chapter and example is about how to create a gui and display your own pic on it
I just added a few loggers for my convenience to check where
the problem is .

I am not getting the image object as null but the method drawImage returns false.
I put the pic in the same folder as the java soyrce file , still the problem persists.

12 years ago

I hope this is the correct way of loading the image using the image as an instance field
and setting it in the constructor.
I have the image in the desktop as well as in my project directory in eclipse.
12 years ago
I tried this example from HeadFirst Java..

Am i going wrong anywhere?
12 years ago

when i run this program , the frame is displayed but without image.
Please suggest if i am doing some mistake.

Thanks in advance
12 years ago
I have Oracle 9i installed on my system which I did not use for a long time

Now I am just trying to access it but unable to do so

I am trying to run oracle through the executable /oracle/ora90/BIN/sqlplusw.exe

It asks for user name , password and host string..

Please tell me what can i give for those values

Are there any default values
12 years ago

Rob Spoor wrote:What if you need to change them? If you put them in a class or interface you would need to recompile not only that class, but the entire application because the constants are probably inlined* wherever they are used. By putting them in property files (or any other form of configuration files, e.g. XML) you can modify the file and restart your application, and all code will use the new values. This also allows non-programmers to modify them if needed.

Whats the meaning of " constants may be probably inlined" as said above..

also in case of properties file also we need to restart the application in order to reflect the changes, so is it a lot better than
maintaining those changes in a java file?
12 years ago

Hi ranchers,

Please tell me what are the advantages of using properties files in a web - applicaton
as compared to writing them as constants in a java class or interface?
12 years ago

why does the above java code not give error during compile time rather
than throw ClassCastException at run time?
12 years ago
I added the necessary jars.. I had thought that all jars would be available with
the Spring 3.0 distribution i downloaded and added in my classpath.

But few of the jars were missing..When aop is integral to Spring
i cant understand why we have to add some jars separately
12 years ago
Hi ,

I tried the example of Spring aspects given in Spring in Action 3rd Edition(Manning).
I am having the problem while running the example.
Following are the java source files and xml configuration file.


The error am getting is follows

Please suggest what is the error?
12 years ago
I am not able to understand how the below code works even
though I have not loaded the MySQL driver?

What is the use of JDBC URLs? what is the rationale behind it?

When I execute the above code I get the following error

javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(
at javax.naming.InitialContext.getDefaultInitCtx(
at javax.naming.InitialContext.getURLOrDefaultInitCtx(
at javax.naming.InitialContext.lookup(
at com.rajiv.TestDB.readDataFromDataSource(
at com.rajiv.TestDB.main(

I am using MySQL 5.5 and Weblogic 10.3.4 .. Please suggest what is the problem?
12 years ago

I am getting the following error when i execute the above code

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClassInternal(
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(
at com.rajiv.TestDB.readDataFromDB(
at com.rajiv.TestDB.main(

Please suggest why the above error is coming? where do i need to put the driver file for MySQL?
I installed the community server edition 5.5 .. but how can i create tables through a GUI tool?