tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "mike jackson" <mjack...@cdi-hq.com>
Subject RE: JDBC-ODBC bridge error
Date Tue, 01 Apr 2003 23:09:40 GMT
Remember though that Oracle and Access syntax is a little different.  If
most cases it doesn't matter, but sometimes it does.  For instance, if
you're working with dates it's a little different (if you're converting
the date from a SQL date to a text date).

However, that said, here's some things to consider:

1) PreparedStatements seem to be faster for data access when you're
talking to Oracle.  I don't know why this is, but when I switched from
Statements to PreparedStatements my speed went up.  Also with
PreparedStatements you don't have to worry about cleaning the input from
users prior to putting it into the SQL (example you're looking for
"'this'", the "'" is a reserved character).

2) If you're working with Oracle they have a XSQL Servlet in the XDK.
It's faster for accessing the database than anything I've been able to
write.  However that Servlet won't talk to Access.  This is also nice
because you can setup one xsql file to get the data and several xsl
files to format it for display.

3) If your web app is updating tables in Oracle you really ought to use
stored procedures in the database.  Access stored procedures and Oracle
stored procedures aren't the same syntax wise.  And they'll probably act
differently as well.

--mikej
-=-----
mike jackson
mjackson@cdi-hq.com

-----Original Message-----
From: Sandra Patricia Hunter [mailto:redbirdofthesouth@shaw.ca] 
Sent: Tuesday, April 01, 2003 2:13 PM
To: 'Tomcat Users List'
Subject: RE: JDBC-ODBC bridge error

Thanks guys! This is what works:
String sqlString = "SELECT str_card_fields FROM card_type WHERE
str_card_type='"+cardType+"';";

Sandra Patricia Hunter
Systems Development and Web Design 
 


-----Original Message-----
From: Filip Hanik [mailto:mail@filip.net] 
Sent: April 1, 2003 2:06 PM
To: Tomcat Users List
Subject: RE: JDBC-ODBC bridge error


it is just a typo, I think what you want is this

String sqlString = "SELECT card_type.str_card_fields FROM card_type
WHERE
(((card_type.str_card_type='"+cardType+"'));";

cardType, is from you java and is a parameter

Filip

> -----Original Message-----
> From: Sandra Patricia Hunter [mailto:redbirdofthesouth@shaw.ca]
> Sent: Tuesday, April 01, 2003 1:54 PM
> To: 'Tomcat Users List'
> Subject: JDBC-ODBC bridge error
>
>
> I am using the JDBC-ODBC bridge driver during development because I 
> don't want to load Oracle on my system here and am using Access for 
> now, and will be using Oracle in the final production. I know I know: 
> it isn't good but I
> don't think it is the heart of the problem.
> I don't know if that is the source of the problem but I am getting
this
> error message:
> [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected
1.
> only on one page while the others using the same driver don't produce
that
> error. It may just be an SQL error. Here is the code snippet:
>
>     String cardType = manageData.getCardType();%>
>     <P> cardType: <%=cardType%></p> //this is just a debug line and

> produces the required value
>     <%
>     String sqlString = "SELECT card_type.str_card_fields FROM
card_type
> WHERE (((card_type.str_card_type=cardType));";
>
>     ResultSet rs = statement.executeQuery (sqlString);
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message