sumana ar

Greenhorn
+ Follow
since Aug 06, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by sumana ar

hi,
i have some pairs of values like name and date to be displayed in a single select box. now what i need to do is align the name to left and the date to right in that select box...is that possible..if so please suggest the way out..
thanks
--sumana
hi,
i've a jsp page where in i pass queries to the bean and get back vectors. i retrieve the info from the vector as follows..res is the name of the vector.
int i = 0;
while(i < res.size()) {
variable = res.elementAt(i);
out.println(variable+"<BR>");
i = i+1;
}
i used the same logic in other jsp, which worked fine. but in this page it shows an oracle error 'Invalid state for getResultSet'. when i refresh the jsp page, then every thing works fine... but what could be the problem...am i missing out something...this problem is annoying me..any help is appreciated.
thanks
--sumana reddy.
hi,
i'm using 2 frames containing 'one.jsp' and 'two.jsp' in a JSP page('main_page.jsp'). when i submit a form in 'two.jsp frame', then 'main_page.jsp' has to open up reflecting the changes done. but the problem is, after submitting, when 'main_page.jsp' is opening, some times(not always) 'one.jsp' is showing a "general error" error..and when i refresh(re-load) only that particular frame, it opens up. well, do anyone know what the problem could be??
any suggessions are appreciated.
thanks
--sumana
21 years ago
JSP
opening in the frame depends on the validations in the second jsp page(two.jsp)
actually if something is true..it has to redirect to the same frame else to another page which does not have any frames...
i hope i'm clear..
--sumana
21 years ago
JSP
hi,
i've a jsp page (one.jsp)containing who frames (contents and main). The main fame has a form that calls another jsp page (two.jsp). twp.jsp has to do some validations and redirects back to the same page in the frame(main) or to a different page depending on the validations.
now the problem is with the redirection to a different page. it is opening up in the frame(main) instead of in a different page. i've used jsp:forward tag for redirecting.
how can i achieve this..please treat this as urgent..
--sumana
21 years ago
JSP
hi,
i've installed Tomcat as a service. when i use http://localhost:8888 its displaying the home page of Tomcat..but when i try to run any application, i get a "page cannot be displayed" error. and then when i try to start tomcat from the startup.sh in bin directory, a page opens up and closes immediately before i could read the contents...
as suggested by someone ...i've increased also the environment space, but was of no use.
what could be the reason...
--sumana
21 years ago
hi,
i'm using Apache Tomcat/4.1.27 and j2sdk1.4.2
i've set the port to 8888 and every thing was working fine. but when i restarted my system and started tomcat.. there's an error saying that the specified port is being used by some other application.
when i changed the port, it's working fine until i again restart my system..
O.S used is windows2000.
please someone help me overcome this problem..this is urgent..
thanks.
--sumana
21 years ago
i usually use a string to store the url and pass that string to the action..this is shown below..
-------------------------
<%
String att = (String) session.getAttribute("theName");
String url = "http://localhost:8080/SDC1/servlet/parserupload?Name="+att;
%>
<FORM ACTION=<%=url%> METHOD=POST ENCTYPE="multipart/form-data">
---------------
hope this helps solve u'r problem

--sumana
21 years ago
JSP
hi,
thanks for those suggessions..
as far as closing the resultset ..i'm calling another method which closes the conneciton. so this method is diferent from the one which returns the resultset..
but guys...after making some minor changes the problem is solved..
once again thanks for the help..
--sumana
hi,
i'm no expert in Microsoft Access... try using the following code..where dsn_name is the name of the data source name(DSN) created for the database.
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc dbc:[B]dsn_name/B]" , "login_name", "password");
Statement s = con.createStatement();
--sumana.
hai..
i tried it the same way ..and that was working fine. this is the code that i used to instantiate the connection...
code.....

public ResultSet execute_prepared(String query) {
newdatasheet connect = new newdatasheet();
connect.connectdb();
try{
Connection cont = connect.connt;
pstmt = cont.prepareStatement(query);
pstmt.setString(1,p_date_from);
pstmt.setString(2,p_date_to);
rs = pstmt.executeQuery();
}
catch(SQLException e) {
System.out.println("sqlexception error..." + e);
}
return rs;
}

i've set the connt (Connection variable) as public in the connect class...and this the whole thing works fine..
--sumana
hi gayatri..
this is what sandeep has said...
"You would need to use a different Statement object, if you want to do it in this way.
code:
----------------------------------------------------------------------------
Statement stmt1 = myConn.createStatement();
query = "update TransactEJBTable set comments = '" + request.getParameter(strIndex) + "' where ResId = '" + ResId + "' and RevId = '" + RevId + "'";
out.println(query);
stmt1.execute(query);
--------------------------------------------------------------
that is what i'm doing...i've written the whole query in a seperate string and sending that string to the java bean method as a parameter..but the problem is not solved...can u plz look into this...i'm stuck here and not able to proceed further...
--sumana.
hi,
I'm trying to make an advanced search page in JSP where the user can search based on certain criteria...and I want the user to be able to leave some of the criteria blank
so i've done some thing like this,
String query = "Select * from <table_name> where";
if (value in param is not null) then
appended the condition to the query
end
finally, after appending the query would look something like this..
query = "SELECT * FROM emp WHERE (emp_id = 13 OR emp_id <> 55) AND (emp_name like 'SMIT%') ORDER BY emp_name, emp_no"
now i'm sending the whole query to a bean which return back the result set.
when i write ResultSet rs = beanid.exec(query);
i'm getting an error that the Result Set is closed...here exec is the method which returns the resultset
what could be the problem..some one plz help me solve the problem..
thanks.
--sumana
--
String query = "Select geom from interstates";
Statement stmt = (Connection.conn).createStatement(); //this line gives the error
--
Are both the classes in the same package?
try out this way and check for the results..
OracleConnection cont = Connection.conn;
Statement stmt = cont.createStatement();
ResultSet rs = stmt.executeQuery(query);

sumana
thanks for all those sugessions...
actually i havn't given any value attribute to the text field and so an empty string is passed when nothing is selected.
the problem is solved and anyways thanks for the help
sumana
21 years ago
JSP