vikhyath reddy

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

Recent posts by vikhyath reddy

looks like you have changed your post from "its rare to see..... " to 'not a good advice' . Well i am still learning and i am hardly 20 years.Been 2 months that i started working with java web. You are experienced enough bear... and this forum is meant for everybody i guess , not just for the ph.d's !
15 years ago
JSP
no you cannot . In order for you to hold a result set type you need to assign the call within the method to the result set object in the jsp page. This process is complex and provides you with little variety . Every time you need a different database functionality you need to recompile your bean class and restart your server . So instead try including the jdbc code within the jsp page if you have a need of accessing different databases with the results being different from each other .



~ Happy coding ~
15 years ago
JSP
You cannot directly access rs.next() without calling a call to the method in bean . Instead try calling any method in the bean . Just by involving the useBean tag doesn't give you the beans methods (its not some kind of an import ) . call some method in the bean --- <% beanId_Name.method(); %> will give you the access to the method ....


~ Happy coding ~
15 years ago
JSP
this is the exception i am getting -----


com.mysql.jdbc.NotUpdatable: Result Set not updatable (referenced table has no primary keys).This result set must come from a statement that was created with a result set type of ResultSet.CONCUR_UPDATABLE, the query must select only one table, can not use functions and must select all primary keys from that table. See the JDBC 2.1 API Specification, section 5.6 for more details.
what i want to ask is .. is there any relation between

Statement st=con.createStatement(* arguments *); and rs.updateString(int,"string") method ... like for rs.updateInt(int,int) i

had to create st as ---- st=con.createStatement(ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_UPDATABLE); so what is

the appropriate syntax for updateString(int,"string"); when it comes to st .... thanks in advance !
hello everybody , nice to be back .. i started having some problems with rst.updateString(...) method.. here is my code :


try{
String url="jdbc:mysql://localhost:3306/vikh?user=root&password=admin";

con=DriverManager.getConnection(url);
stmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE); // **** guess there is a problem here
rst=stmt.executeQuery("select * from trial_auth1;");
ResultSetMetaData rsmd=rst.getMetaData();
int cnt=rsmd.getColumnCount();
while(rst.next()){i++;} // check no. of records
m=i;i=0;
out.println("No. of rows : "+m+"
No. of colls : "+cnt);
int r=10;
int c=1;
rst=stmt.executeQuery("select * from trial_auth1 order by sid;");
while(rst.next())
{

String h1=Integer.toString(r+c);c++; // *** getting output here
String h2=Integer.toString(r+c);c++; // *** getting output here
String h3=Integer.toString(r+c); // *** getting output here

String g1=request.getParameter(h1);
String g2=request.getParameter(h2);
String g3=request.getParameter(h3);

out.println(g1+" "+g2+" "+g3); // *** getting output here

rst.updateString(1,g1);
rst.updateString(2,g2);
rst.updateString(3,g3);

out.println(g1+" "+g2+" "+g3); // *********** NOT GETTING THE output
rst.updateRow();
c=1;r=r+10;
} // end of while



..... Thanks in advance
hello people... please help ... it is still not working even after i have configured the above settings !
15 years ago
Thanks for your reply ... i followed your instructions

i tried configuring ... this is what i have done ...


Name - tomcat

Source IP : 116.74.131.70 , Mask : 255.255.255.255

Destination IP : 192.168.15.2 Mask : 255.255.255.255

Port Start , Port End , Port Map : 8080

Protocol : TCP
15 years ago
it is perfectly working fine on the intranet but across the internet it isnt .. there is no port blocking access(coz its working fine in the intranet since i changed the port settings to "acceptable @ 8080" )
15 years ago
it says connection timed out ! ... guess its a network prob... but y isnt it opening across the internet ?
15 years ago
hello everybody ... m trying to access the tomcat server of my friends computer which is located on a different subnet across the internet ... if i type the URL like http://IP_ADDRESS:8080/file.jsp then its givin me an error.. please help
15 years ago
Thanks a lot Masoud ... Im a newbie so learning things ... thanks once again ! : )
Hello everybody... i have a program code which needs to update the fields provided by the user . i am doing something like this.. i have a mysql table which has 27 rows and 20 columns in each row.


<%
String url="jdbc:mysql://localhost:3306/vikh?user=root&password=admin";

con=DriverManager.getConnection(url);
stmt=con.createStatement();
rst=stmt.executeQuery("select * from it_21;");
while(rst.next())
{

out.print("inside while"); //this is getting displayed

rst.updateInt(3,123445); // the program flow is stopping at this point.

rst.updateRow();

out.print("In while"); // this is not getting displayed

}

---- rest of the code ------

%> Thanks in advnace
thanks.. and what about denying all request for an amount of time instead of denying him forver ? how to implement that
15 years ago
JSP
yes exactly ! thanks for your response ... so how do i go about it ?
15 years ago
JSP