This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!

rajnish patel

Ranch Hand
+ Follow
since May 23, 2013
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
8
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by rajnish patel

I am retrieving value from database via java method to a jsp.

If I try to get value on a textbox, it displays on appropriate textbox, but I want that value to be selected in a dropdown list.
Please suggest correction.

Hereby I've attached codes for both views, textbox and dropdown list.

Working,





Not working,

4 years ago
JSP

rajnish patel wrote:

chris webster wrote:The error message tells you what Oracle thinks is wrong:
Are you really running exactly the same Java and PL/SQL code on two databases (can you even be sure, given how unreadable your PL/SQL code is)? If so, then it must be the argument values that are wrong, so check that each parameter is being provided and is being set correctly. Also, try calling the PL/SQL directly using the same values via SQLDeveloper or in your SQL*Plus shell. If it works, then the problem must be on the Java side. Keep breaking the process up into small testable chunks until you find the problem.

But you *really* need to re-write this PL/SQL code, as it is not the kind of thing that any self-respecting Oracle professional should permit in a production system.




Sir I've found problem of this problem, While executing the query from toad I dont understand what to enter in HIGHLIGHTED area as its an array. The procedure name is same as posted above in the Question. Kindly refer the image attached in below URL.
Toad Query Execution image




@sir
Problem solved, I was connecting with the third database I had in file.properties file, connected with right db and solved. By the way the SP was not available in that third db thats why I was getting the issue. Thank you for the help.

chris webster wrote:The error message tells you what Oracle thinks is wrong:
Are you really running exactly the same Java and PL/SQL code on two databases (can you even be sure, given how unreadable your PL/SQL code is)? If so, then it must be the argument values that are wrong, so check that each parameter is being provided and is being set correctly. Also, try calling the PL/SQL directly using the same values via SQLDeveloper or in your SQL*Plus shell. If it works, then the problem must be on the Java side. Keep breaking the process up into small testable chunks until you find the problem.

But you *really* need to re-write this PL/SQL code, as it is not the kind of thing that any self-respecting Oracle professional should permit in a production system.




Sir I've found problem of this problem, While executing the query from toad I dont understand what to enter in HIGHLIGHTED area as its an array. The procedure name is same as posted above in the Question. Kindly refer the image attached in below URL.
Toad Query Execution image

chris webster wrote:One more thing you might find useful: You can use a "TABLE" function to convert a PL/SQL collection into something that you can treat like a regular table inside a SELECT statement. Check here under "Selecting From A Collection Based On A VARRAY". This might help you find a way to use your input array inside your SQL, for example.





I have two databases having same table structure, I tried with another db and its working fine, but while connecting to this db I am getting this error. Any clue ?? –
I am getting following error for the stored procedure and not able to understand the issue (must be from db side) While googling, I found similar issues but could not get the solution. Can any one help me please find the error in PROCEDURE ??


Error :-




Stored Prodedure(SP_DIST_RETAILER_REMAP) :-










Java Code :-

Peter Johnson wrote:The solution is simple - don't install in "Program Files(x86)". In fact, I advise against installing *any* Java application within a directory with spaces in the name. Such paths can cause problems in a wide variety of Java libraries.

On my system, I put it at c:\apps.




Worked for me sir, 10q
6 years ago

Martin Vajsar wrote:I'm still not sure what are you asking about. Do you want a more in-depth explanation of how storing SQL queries in properties file works?



I just want to know what SQL Procedures are and why it is used...!!

Martin Vajsar wrote:I'm not sure I'm understanding your question correctly.

Maybe you're asking about storing the actual texts of SQL queries in a file (usually a "standard" Java properties file), instead of hard-coding them in the application (in Java source code). The advantage of this approach is that all the SQL queries are separated from Java code, where they can be inspected by an experienced DB programmer (not all Java developers are on good terms with SQL), and they could even be automatically tested for correctness by some sort of unit test. A possible disadvantage is that this approach might make creating dynamic queries more problematic, if not impossible.

But if you asked about something else, please clarify your question.



Thank you sir,
I got answer for what I asked.
please help me with my first question....


Thank you so much again for helping....
hi all,
I have knowledge of SQL Queries and oracle 9i,10g,11g. Well I searched a lot related to SQL procedures on internet but could't understand properly. So can anybody explain me it properly?
Moreover I also want to know about data which is stored in .props files. What is that data and how it is used ?? Please explain in detail. Also let me know that why .props files are used ?

Waiting for kind reply.
Thank you.

Maneesh Godbole wrote:Your array list contains 3 elements
Indices start at 0
So when you say
you are actually asking for the 4th element which does not exist, which is what the exception means







First of all thank you for reply Sir.
and I knowwhat you said but my question is that why didn't I get error like x>y ??

6 years ago
Hi all,
I am working on a project and getting this error " java.lang.ArrayIndexOutOfBoundsException: 2 >= 0"
I've problem related to this, I know that this is ArrayIndexOutOfBoundsException :P but
taking look at this sample example,



we get following error,
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 3, Size: 3

Here we don't see anything like, x<=y

and in my code, i amg etting 2>=0 error after ArrayIndexOutOfBoundsException
So my problem is that, when do we get such 2 >= 0 like errors ?
6 years ago

E Armitage wrote:Again check the server logs for any errors.




but sir this time m not getting any kind of errors......

E Armitage wrote:The error came up in the servlet not in the user dao. You can find out where the error was thrown by looking at the line numbers printed out in the stack trace. It says . So the value passed to Long.parseLong at that line is not a number.



I solved that error,
Now I am not getting any error, and page is redirected to view portion, but data is not updated....
Now what ?

E Armitage wrote:The error says that line 55 threw a number format exception. So that means that the value of monu variable is not a valid number at that point and an exception is thrown which results in none of your edit code being called on the DAO.




thank you for reply sir,
well I am a beginner and this is my UserDAO file,
can you please suggest me changes needed ??


UserDAO.java
Hi, I've developed a CRUD application and it is working but I am not able to update data which is already inserted. Here is my code, tell me if any other file is needed..

I am pasting error below








Error