 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
homerpicard Guest
|
Posted: Mon Jul 21, 2003 7:07 pm Post subject: prepareStatement Strange-ness |
|
|
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
|
Posted: Mon Jul 21, 2003 7:18 pm Post subject: Re: prepareStatement Strange-ness |
|
|
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 |
|
 |
|
|
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
|
|