By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,643 Members | 1,327 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,643 IT Pros & Developers. It's quick & easy.

invalid descriptor index???

P: 1
import java.sql.*;
import java.util.Date;
import java.text.ParseException;
import java.util.Calendar;
import java.text.DateFormat;
import java.util.Date;


class DataBase{
public static void main(String a[]) throws Exception{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

int temp1=0;
// String s;
// Format formatter;



Date date = new Date();


Connection con=DriverManager.getConnection("jdbc:odbc:Dischar ge");
System.out.println("Sucessfully Connected ");
Statement st= con.createStatement();
ResultSet rs= st.executeQuery("select Discharge_Value from Taunsa_Normal");

//ResultSet rs= st.executeQuery("select Flood_Date, Time, Discharge_Value from Taunsa_Normal");



while(rs.next()){


/*
temp1=Integer.parseInt(rs.getString(1));
System.out.println(temp1);



System.out.println(rs.getDate(2));

*/

temp1=Integer.parseInt(rs.getString(1));
java.sql.Time dbSqlDate = rs.getTime(3);
java.sql.Date dbSqlTime = rs.getDate(2);



System.out.println(temp1);
System.out.println("dbSqlTime=" + dbSqlTime);
System.out.println("dbSqlDate=" + dbSqlDate);



}
System.out.println(temp1);







st.close();
con.close();

}
}
Feb 11 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.