Win a copy of Kotlin for Android App Development this week in the Kotlin forum!

Dave Tolls

Master Rancher
+ Follow
since Sep 04, 2013
Cows and Likes
Cows
Total received
45
In last 30 days
5
Total given
0
Likes
Total received
649
Received in last 30 days
12
Total given
21
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dave Tolls

Can you post the exact javac command you are using to compile this?
Include what directory you are executing it from.

Also, can you check whether you have declared a CLASSPATH in your environment variables...if you have hten that is probably the root cause of your issue.
1 week ago
Yes.
There's something like:

in the query method.
1 week ago
The query method does the iterating over the ResultSet, calling your mapper for each row.
1 week ago

Rob Spoor wrote:If you read your error page, it's actually very clear. On line 12 through 16 there is a call to getparameter which, according to the error message, does not exist on HttpServletRequest. That's true - the name is getParameter, with a capital P. Remember that Java is case sensitive, and that also applies to JSP files.



And this highlights why having scriptlets lik this in JSPs is not a great idea.
Had this code been in a servlet then this typo would have been found without having to deploy to a server as the code would not have compiled.

Is it a requirement of some course that this be done in a JSP page?
1 week ago
JSP
That code should be entirely in a servlet, not a JSP page.
JSP's are intended for displaying things, not doing your processing.

This will also help immensely with any debugging...
1 week ago
JSP

Tim Holloway wrote:



Where were you thinking of putting this code?
All the above code is using a try-with-resources call anyway, so I'm assuming I missed something...
1 week ago
Even for applets its dated, since Swing has a JApplet that was intended to be used instead of the AWT version.
1 week ago
So you had multiple jdbc drivers in the classpath?

As for the ArrayDescriptor, there's a method on the OracleConnection called something like createArray to use instead.
1 week ago
Which leaves us with the issue that unwrap is returning a T4CConnection and for some reason casting to an OracleConnection is causing a class cast exception, even though a T4CConnection is-a OracleConnection.

As I said above, the first thing that comes to mind is a class loader issue.
And for that I'm not the best person to ask about those, I'm afraid...
1 week ago
This comes down to your earlier thing regarding using Stored Procedures.

Once you have an Oracle SP which has a parameter that uses a user defined type (in this case it's either a table or VARRAY) then using the Oracle classes to handle that was the only thing you could do.
Had to do it myself more than once back in the day.

I would have hoped (and I thought it had happened) that this cludge would have been sorted by now, but I expect Oracle don't really care all that much.
1 week ago
It's not necessarily the same problem, as the OP is able to run the jar file on other machines, but not this one.
1 week ago

Versha Agarwal wrote:



I thought there was a cure for having to use Oracle classes these days, but I can't seem to find it.

Versha Agarwal wrote:
At this line it gives exception 'java.lang.ClassCastException: com.sun.proxy.$Proxy9 cannot be cast to oracle.jdbc.OracleConnection'  that means OracleConnection is needed

and when I inspect

it returns
oracle.jdbc.driver.T4CConnection@12299890


T4CConnection is-a OracleConnection.
It implements that interface (actually I think there might be an inbetween class).
If you are getting this error with that class then I'm wondering if there's a class-loader issue.

Just to clarify.
conn is the Proxy class.
conn.unwrap is returning the T4CConnection.
1 week ago
What command is being used to run it from the command line?
And what exact error is occurring?
Copy and paste them both here would be easiest.
1 week ago
OK, so it looks like something sitting between your code and the actual connection pool.

Though there's some issues with that code (your getInstance is not threadsafe, for example), it's not relevant to the current problem.

That leaves two things.  First, do you have to get the OracleConnection, and second have you debugged the code to find out what class is being returned, and what it is returning from the call to unwrap?
1 week ago
Yep.
That code forwards to a JSP, which will send the response to the client.
When that returns back to the above servlet it's well past the point you can be messing around with the session.
1 week ago