Hai,
I request you to help me out to solve my problem,
I am trying to display the data from access and orace using ODBC , I get SQLException as:
------------------------
SQLEXCEPTION Occured: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax erro
r (missing operator) in query expression 'merchantname form merchant'.
--------------------------
mycode
~~~~~~~
import java.io.*;
import java.util.*;
import java.sql.*;
public class DBConv {
public static void main(
String args[]){
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(ClassNotFoundException ex)
{
System.out.println(" Class Not FOund Exception :\t"+ ex);
}
try{
Connection acon;
Connection ocon;
acon=DriverManager.getConnection("jdbc
dbc:Merchant");
ocon=DriverManager.getConnection("jdbc
dbc:OraDb","scott","tiger");
Statement astmt = acon.createStatement();
Statement ostmt = ocon.createStatement();
String aQuery;
String oQuery;
aQuery="select merchantname form merchant;";
oQuery="select login from merchant;";
System.out.println(" Access Query:\t "+aQuery+ "\n Oracle Query :\t"+oQuery);
ResultSet ars=astmt.executeQuery(aQuery);
System.out.println(" I am after first Resultset");
ResultSet ors=ostmt.executeQuery(oQuery);
while(ars.next()){
System.out.println("Access:\t"+ ars.getString(1));
//ars.next()
}
while(ors.next()){
System.out.println("Access:\t"+ ors.getString(1));
//ars.next()
}
}// End of try
catch(SQLException e){
System.out.println("SQLEXCEPTION Occured:\t"+e);
}// End of catch
}// End of Main()
}// End of class
thanx
prabhakar