Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

JDBC Problem

  Asked By: Daisy    Date: Jan 20    Category: Java    Views: 805
  

I have the following program it compiles good but when executed gives the
following error

java.sql.SQLException:[Microsoft][ODBC Microsoft Acess Driver][Option feature
not implemented]

import java.sql.*;
import java.io.*;
class dbf
{
public static void main(String abc[])
{
Connection Con;
Statement Stat;
ResultSet Result;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Con=DriverManager.getConnection("jdbc:Odbc:DDD");
Stat=Con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
Result=Stat.executeQuery("SElect * from table1");
Result.next();
System.out.println( Result.getString("Name"));
Result.next();
System.out.println( Result.getString("Name"));
Result.previous();
System.out.println( Result.getString("Name"));

}
catch(Exception T)
{
System.out.println(T.toString());
}
}
}

Share: 

 

4 Answers Found

 
Answer #1    Answered By: Daw Boonliang     Answered On: Jan 20

I'm not positive, but I might comment out the result.previous() line and see
if it works then. Not all support scrolling backward in a result  set.

 
Answer #2    Answered By: Christie Bradley     Answered On: Jan 20

I think it is because you are creating a statement
with the following parameters and I have a feeling
that MS Access is not supporting this operation..

ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE

To test this make your

Stat=Con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);

to

Stat=Con.createStatement();

Note may not be able to go to previous  ResultSet value

 
Answer #3    Answered By: Wendy Harrison     Answered On: Jan 20

I'm using MS Access and the
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE works. I'm using Office XP
and J2SDK 1.4. What are you using? Some Java
compiler does not support the features above.

 
Answer #4    Answered By: Noah Evans     Answered On: Jan 20

your coding is little bit tricky
what will you want to do.
just change the code
while(result.next())
{
System.out.println(result.getString("name");
}
remove the
result.previous

 
Didn't find what you were looking for? Find more on JDBC Problem Or get search suggestion and latest updates.




Tagged: