You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Halil AKINCI <ha...@ktu.edu.tr> on 2002/09/13 09:14:04 UTC
another sql error
Hi all ,
When I want to run following sql statement in a servlet, I receive following error message in tomcat's DOS console
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
In this sql statement, the "vno" variable is read from a HTML form by using following statement
String vno = request.getParameter("vergino");
Other informations are gotten from MS Access tables (Malik, ParselMalik, KatMalik tablolarından). This sql statement is running correct within the access. I wonder how can I organize this sql? Can anyone help?
("SELECT Malik.VergiNo,Malik.Adı,Malik.Soyadı,ParselMalik.TasınmazID,ParselMalik.Hisse " +
"FROM ParselMalik,Malik WHERE Malik.VergiNo="+vno+" AND Malik.VergiNo=ParselMalik.VergiNo " +
"UNION SELECT Malik.VergiNo,Malik.Adı,Malik.Soyadı,KatMalik.TasınmazID,KatMalik.PayMiktarı " +
"FROM KatMalik,Malik WHERE Malik.VergiNo="+vno+" AND Malik.VergiNo=KatMalik.VergiNo");
RE: another sql error
Posted by Galbayar <ga...@mobinet.mn>.
try use Statement
String vno = request.getParameter("vergino");
String Query="Select malik.VerginNo From ParselMalik Where Malik.VergiNo=?";
PreparedStatement st=mysql.prepareStatement(Query);
st.setString(1,vno);
-----Original Message-----
From: Halil AKINCI [mailto:hakinci@ktu.edu.tr]
Sent: Friday, September 13, 2002 4:14 PM
To: Tomcat Users List; servlet-interest group; jakarta-tomcat yahoo
groups
Subject: another sql error
Hi all ,
When I want to run following sql statement in a servlet, I receive
following error message in tomcat's DOS console
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
In this sql statement, the "vno" variable is read from a HTML form by using
following statement
String vno = request.getParameter("vergino");
Other informations are gotten from MS Access tables (Malik, ParselMalik,
KatMalik tablolarýndan). This sql statement is running correct within the
access. I wonder how can I organize this sql? Can anyone help?
("SELECT
Malik.VergiNo,Malik.Adý,Malik.Soyadý,ParselMalik.TasýnmazID,ParselMalik.Hiss
e " +
"FROM ParselMalik,Malik WHERE Malik.VergiNo="+vno+" AND
Malik.VergiNo=ParselMalik.VergiNo " +
"UNION SELECT
Malik.VergiNo,Malik.Adý,Malik.Soyadý,KatMalik.TasýnmazID,KatMalik.PayMiktarý
" +
"FROM KatMalik,Malik WHERE Malik.VergiNo="+vno+" AND
Malik.VergiNo=KatMalik.VergiNo");
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>