Kameswari Jyosyula

Ranch Hand
+ Follow
since Feb 20, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Kameswari Jyosyula

Hi,
I have created a BC4J for JSP application. I would like to enahce it further(right now most properties/events are default).The data shown in the JSP pages are not dynamic i.e. i have to use the navigation buttons to go to the particular record.I would like to be able to click on the record to open a edit_jsp page. Also is there any way in which i can sort the data by some of the columns in the table?I didn't find any option in the Jdev which allows this.Please let me know how i can do the aforesaid.Your help is much appreciated.
TIA-Kameswari

Originally posted by Sarath Chandra:
Haijun,
A brief explanation on how you go ahead with JDeveloper :
1. Create a Project in JDeveloper Workspace (File->New Project).
2. Keep adding all your .java files to this project.
3. You can run any .java file, having a main() in it by right
clicking on that file and selecting "Run".
The most important thing would be the Project Properties window. Just double click on your project, Properties Window would get displayed.
In this project Properties Window, the tab "Run/Debug" is of significance in our scenario.
For the Topic "Debug Session Options", set the "Compile Project Before Running Or Debugging" to true by checking the check box.
For the Topic "Console I/O", select an appropriate thing from the radio group, either to send the output to the Message View, or to send run output to Console Window. [I'd prefer you choose the Console Window Option, every time when you run your program you'd be able to see a new MS-DOS window getting created with your program output.]
've a nice time with JDeveloper!!!


Did u find an answer to that, if so post it here plz
23 years ago
hi,
I would like to know if we can call a msaccess application(.mdb file) through an applet.If so, how to do it?
TIA
23 years ago
Thanks a lot.
That helped.It worked.

Originally posted by SoonAnn Lim:
Hi, as i can see, the solution you look for is not very obvious. There are several problems in your code. First, all sql codes must be in a try and catch block that throw SQLException. Second, you don't know the size of the array you are creating. If i were to solve this problem,
1. i will use a vector to store all the result from resultset. If your result set contains more than one column, then write a simple class to hold all the values from the results, then put the instances of the class into vector.
2. Then i can find the size of the vector using Vector.size, this let me create an array of String (your case) or array of other objects with correct size. After that you want to iterate through all the elements in your vector.
3. Use Enumeration to iterate through your vector. In Vector class, Vector.element() method return the enumeration of vector.
"Enumeration e = v.elements();".
4. Finally, a while loop can help you to iterate through all the element in the Enumeration. "while(e.hasMoreElements())", In this loop, you extract all objects from Enumeration and assign to your array(String or objects) with an explicit cast. The method is "Enumeration.nextElement()". For example,
a=0;
while (e.hasMoreElements()){
str[a++]=(String)e.nextElement();
}
Hope this will help.


Thank you all for your help , i solved this problem.
23 years ago
Hi I am able to get the data into my checkbox by using Vectors.
But I am not able to change the 2ndcheckbox values based on first one.How should i do that?what needs to be changed in my code?Plz help - under time constraint and only this problem needs to be solved.Would very much appreciate ur help.
here is my code:

The problem is that the reuest.getParameter("x") is not getting anything.The next line(out.print(re) ) give a null value.

I very much appreciate ur help.
TIA

[This message has been edited by Kameswari Jyosyula (edited August 15, 2001).]
23 years ago
Could you plz tell me how to get the data into an array in my bean.I am doing the following and obviously the methos returns only the last record .How to change the following code to get the entire result set/data?Plz help

TIA

Originally posted by Brian Nice:
in your bean, if you have the values stored in some sort of array or collection, either use a getter method to return your collection item and loop through the collection to form your drop down, or use an indexed getter to get particular items from your collection.
Example:
<% String [] AValues = bean.getValues();
if (Avalues != null) { %>
<select name="dropdown">
<% for (int i=0; i<Avalues.length; i++) {
String val = AValues[i]; %>
<option value="<%=val%>"><%=val%></option>
<% } %>
</select>
<% } %>
HTH
Brian


23 years ago
the point is the left hand side (array) is incompatible with the right hand side (String).Also the return statement for the method has to be outside the while loop so it returns only single value not all.

Originally posted by Vishakha Ahuja:
Since you have defined a while loop, why don't you use an index for array :
int a = 0;
while(rs.next()) {
stringArray[a] = rs.getString("x");
a++; }


Hi, I am trying to get data from a db into my jsp page as an array.How do i do that?
I am calling the returned value from my method.But if i give the return type as String only a single value is returned.
I tried to use array.
if i say

i get an error (obviously for String [] and String are incompatible)I get the sam incompatible error if i use Array[] and getArray().So how to return the string type column(x) as an array?
Plz help
TIA

[This message has been edited by Kameswari Jyosyula (edited August 14, 2001).]
right guys,
i share ur concern regd the client being able to access the db.So what we did is a sort of workaround - we created a db with guest as user and pwd and and gve that user very limited privileges and also the new db has nothing sensitive.thus avoided the userid and pwd of the db itself.ofcourse we are using the post method
thanks
23 years ago
I am trying to give a link to a crystal report in my jsp file.The crystal report accesses a database.Hence in my url i am passing the username and password for the database.(different from the user loign)ex: http://myurl.com?user0=myuser&password0=mypwd
I don't want the user to see this.Is there any other way of passing this data(say put them in cfg file and call them in this url). like user0=mybean etc
If not is there any way of disabling the user from seeing the userid and password?(both when the user points the mouse on the link and when the view source is selected from the browser menu)
TIA
23 years ago
But in ur code after the if loop u r hardcoding the options for select.I don't want to do this.There instead of hardcoding, I would like to select from the database(by using a bean I am getting the values i need through different methods.How to add the data to the list box by calling those methods)
23 years ago
Hi,
I am able to acheive this by using Javascript but that needed hardcoding of the data in the table.I would like to avoid the harcoding.How can i select the data in to the dropdown box?I am doing something like below:
<select name=select1 ....onChange=myfunction()..>
The 'myfunction()' checks for the value of select1 and if it is A displays the various options under A and if its b display for B.
I have created a bean which does select the required data(the method returns all the data of column 1 in my table)How do i pass this data into 'myfunction()'? I tried passing it into a variable like var i = <% =mybean.mymethod() %> but this doesn't work.Can you give me an example of passing the data into the drop down menu, so i can see where i am going wrong.
Thank you for ur help .

Originally posted by Brian Nice:
When you come into the page, you could load some javascript arrays with all the selections for A, and another array to hold the selections for B. Then when the user chooses A or B, use javascript to change the values in the drop down menu.
Or you can refresh the page and send the page on the URL line, the selection of A or B. So when the user changes his selection, refresh the page with a parameter showing which was selected by appending it to the URL line, then get the selection from the request and based on that choose which drop down box you would like to display.
And yes, you can choose the drop down menu items from the database. I use a custom tag to do that, but you could also use a bean to read from the database and use JSP to go through th resultset and build the drop down box, or something similar.
HTH
Brian


23 years ago
Hi,
I want to know how i should go abt doing the following.
I want to give the users tow choices say A and B (want to use radiobuttons, but am willing to try anything else).If the user selects A I want to show list1(dropdown box) or if the choice is B i want to show list2.Also later when the user submits the form i want to insert A(or B) and the selected choice from the dropdown box into the database.How should i program this?
Also , is it possible to get data into dropdown box from the database directly(through a query)rather than by hardcoding the choices?
Please advice.
TIA
23 years ago
right, I am using the invalidate() method and also am using the databse tables to check for the validity of user login.That is NOT a problem.What i am trying to check is this - the user logs in, browses/does something on the site(whatever) and then instead of loggin out he/she just closes the "x" button on the browser window.When this happens i want the user's session to end.(i.e to be logged out).I tried using Javascript for prompting the user to logout(by using onUnload() ).But in this case, even when the user is properly logged out, still the propmt appears asking the user to logout properly.How do i solve this problem?
23 years ago