SQLException « ODBC « Java Database Q&A





1. Why am I getting the error SQLException: [Microsoft][ODBC Excel Driver] Too few parameters. Expected 1    stackoverflow.com

I am using the following code for uploading keywords & count to an Excel file. I am having the keyword_id as primary key for that one. I am having the two ...

2.  java.sql.SQLException:[Microsoft][ODBC Driver Manager] Invalid descriptor index    stackoverflow.com

I use the following code

try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:access");
    String sql = "Select * from table";
    Statement ...

3. SQLException: [Microsoft][ODBC Driver Manager]    coderanch.com

What OS are you using? I will assume win2K. It has to be windows. "COFFEEBREAK" is the name of the datasource not the database file name. to set up a datasource go to control panel. Open administrative tools. Double click "Data Sources(ODBC)" go to system DSN tab. choose add. Pick the microsoft access driver. give it the datasource name COFFEEBREAK. choose ...

5. JDBC ODBC SQLException    java-forums.org

import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class CoalReporter { public static void main(String[] args){ String data = "jdbc:odbc:WorldEnergy"; try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection conn = DriverManager.getConnection( data,"",""); Statement st = conn.createStatement(); ResultSet rec = st.executeQuery( "SELECT * "+ "FROM Coal "+ "WHERE "+ "(Country='"+args[0]+"') "+ "ORDER BY Year"); System.out.println("FIPS\tCOUNTRY\t\tYEAR\t"+ "ANTHRACITE PRODUCTION"); while(rec.next()){ System.out.println(rec.getString(1)+"\t" +rec.getString(2)+"\t" +rec.getString(3)+"\t" +rec.getString(4)); } st.close(); ...