Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.

Rao Raghu

Ranch Hand
+ Follow
since Jan 05, 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 Rao Raghu

Mr Mike, your question is not quite clear. If you want to replace that default.jsp having the scriptlets, with a bean, then write a java class which accomplishes the same functionality as the scriptlets. Also in the <jsp:useBean >tag you have not mentioned the 'class' attribute.
10 years ago
JSP
Java for the Web with Servlets, JSP, and EJB: A Developer's Guide to J2EE Solutions (Landmark) (Paperback)
by Budi Kurniawan (Author)

This is good for the beginners.
10 years ago
JSP
I need to enter both date and time in a table in Oracle in a column which is of type 'Date'. In the 'update table' query, I use the following for conversion:

to_date('dateString','yyyy-mm-dd hh24:mi:ss');

But I am getting this error:

ERROR at line 1:
ORA-01830: date format picture ends before converting entire input string

I have googled for this query and found that it is perfectly alright.

The dateString will be a date viz. '2007-06-14 09:31:24.762'.

Any body has any inputs on this?

Thanks in Advance.
Hi, I had posted earlier with an overview of my StackOverFlow Error problem. Now I have got some clues in this. The servlet is throwing a Stackoverflow error at Properties.getProperty() method. I know that stackoverflow occurs as a result of recursions. But I am not making any recursive calls in my code. I don't know why this error is bugging me. The code segment and the exceptions are listed below:



The exceptions:



Any clues will be appreciated. :roll:
11 years ago
Hi, I wanted to know if it is alright to instantiate a javabean? I am not sure if this is the right forum for this question. I am accessing the methods of a bean from a servlet. The servlet is throwing StackOverFlow Error. Also, I am creating instances of the bean in the servlet with the new() operator. The codes are developed by someone else in the past and now we are struggling to rectify this StackOverFlow Error. I've read somewhere that beans don't have explicit constructors, but ours has one. Is this constructor thing is what is causing the StackOverFlow Error? I am not able to figure out.

Any help will be of great help.
11 years ago
JSP pages to be placed inside Webapps directory.
11 years ago
It means that you have to write a javabean that has a method to establish database connection using JDBC. The method shall return a connection object. You have to call it with <jsp:useBean> action element in those JSPs where you want DB connections. Be sure to provide a code to close the connection after use.
11 years ago
JSP

ya.. using drivers



Which dtabase are you using? Are you using the drivers provided with the database? If yes, then it should not crash. The reason may be something else.


Originally posted by Paul Sturrock
If you give someone a hammer and he uses it to hit himself on the head, is it the hammer's fault he's able to hurt himself?



I got your point , Paul.


11 years ago


Originally posted by Stan James:
class names start with a capital letter, variable names do not



This is just a convention. Even otherwise the class will compile and run fine. We are not bound in any way to follow the convention. The bottom-line is 'why should the language allow us to use class names as variable names in the first place?'



11 years ago
Import the following:



String url = "jdbc:mysql://localhost:3306/mysql";



Are you sure the name of your database is 'mysql'? In the subsequent code you are also creating a database:


stmt.executeUpdate("CREATE DATABASE JunkDB");


(String courseName.Int courseGradePointAverage)



Is it a dot? I suppose it should be read as a comma, right?
11 years ago


Originally posted by Stan James:
I can't tell if you were confused by it or amused for the same reason I was surprised - class names are not reserved words.



Isn't this a kind of a drawback of java which eats into the readability of the code? An example is the class shown in this thread


11 years ago
Whats the difference between 'Order by' and 'Group by'in SQL? Where do we use each?