AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

prepareStatement Strange-ness

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases
View previous topic :: View next topic  
Author Message
homerpicard
Guest





PostPosted: Mon Jul 21, 2003 7:07 pm    Post subject: prepareStatement Strange-ness Reply with quote



Hi. I'm using Visual Age for Java (3.5.3). Problems with
prepareStatement. Basically it used to work and now doesn't. On
inspection I've found strange behaviour. using

sqlStatement = connection.prepareStatement(sqlString)

works and renders the resultant JSP page, whereas:

sqlStatement = connection.prepareStatement( sqlString,
result.TYPE_SCROLL_INSENSITIVE,
result.CONCUR_READ_ONLY);

renders the 'page cannot be displayed message'. Is there an issue with
Visual Age and the preparedStatement? Any ideas, please? A segment of
the code is detailed below. Many Thanks

_____________________________________________________________________

private java.sql.PreparedStatement sqlStatement;
connection = poolManager.getConnection();
StringBuffer sqlString = new StringBuffer();

sqlString.append( "select col,");
sqlString.append( "col2,");
sqlString.append( "to_char(col3,'DD/MM/YYYY'),");
sqlString.append( "col4 ");
sqlString.append( "from table_1 ");
sqlString.append( "where col1 ");
sqlString.append( "not in ");
sqlString.append( "(select col1 from table_2) ");

sqlStatement = connection.prepareStatement( sqlString.toString(),
result.TYPE_SCROLL_INSENSITIVE,
result.CONCUR_READ_ONLY);
Back to top
Andy Flowers
Guest





PostPosted: Mon Jul 21, 2003 7:18 pm    Post subject: Re: prepareStatement Strange-ness Reply with quote



Check the exception being thrown.

It's quite likely that the JDBC database driver you are using doesn't
support TYPE_SCROLL_INSENSITIVE and/or CONCUR_READ_ONLY.


"homerpicard" <homerpicard (AT) yahoo (DOT) co.uk> wrote

Quote:
Hi. I'm using Visual Age for Java (3.5.3). Problems with
prepareStatement. Basically it used to work and now doesn't. On
inspection I've found strange behaviour. using

sqlStatement = connection.prepareStatement(sqlString)

works and renders the resultant JSP page, whereas:

sqlStatement = connection.prepareStatement( sqlString,
result.TYPE_SCROLL_INSENSITIVE,
result.CONCUR_READ_ONLY);

renders the 'page cannot be displayed message'. Is there an issue with
Visual Age and the preparedStatement? Any ideas, please? A segment of
the code is detailed below. Many Thanks

_____________________________________________________________________

private java.sql.PreparedStatement sqlStatement;
connection = poolManager.getConnection();
StringBuffer sqlString = new StringBuffer();

sqlString.append( "select col,");
sqlString.append( "col2,");
sqlString.append( "to_char(col3,'DD/MM/YYYY'),");
sqlString.append( "col4 ");
sqlString.append( "from table_1 ");
sqlString.append( "where col1 ");
sqlString.append( "not in ");
sqlString.append( "(select col1 from table_2) ");

sqlStatement = connection.prepareStatement( sqlString.toString(),
result.TYPE_SCROLL_INSENSITIVE,
result.CONCUR_READ_ONLY);



Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.