473,385 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

invalid descriptor index???

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
0 2406

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

Similar topics

3
by: GitarJake | last post by:
Hello all, I am trying to test an ODBC connection to an Oracle dbf using the ODBC Data Source Administrator. It's not working and I suspect I haven't configured Oracle correctly. Below is...
1
by: J. C. Clay | last post by:
We are having some troubles with corrupt indexes on our SQL 2000 dbase. It is only affecting 2 tables out of about 150 we have. These 2 tables are heavily used. We have run dbcc repairs;...
3
by: gipsy boy | last post by:
Given a file descriptor (from a network socket, for instance), I want to have an iostream that reads/writes to it, so I can push and read data in the traditional way : sockStream << "<some...
4
by: Kumar | last post by:
Need urgent help.... I wanted update one table which has a primary key and also has few dependents. I dropped Primary key before update sothat it won't affect the dependent tables. After...
4
by: lynology | last post by:
I need help trying to figure why this piece of code gives me a "Bad File descriptor error" everytime I try to run it and invoke fflush. This piece of code simple outputs a char string to the output...
0
by: ChrisWoodruff | last post by:
I have a C++ function in a COM object that I am trying to implement in VB.NET (the functionality, NOT the COM object, I want to remove the requirement for the COM DLL) I am an experienced VB...
3
by: uche | last post by:
Please give me some feed back on this issue: Here is the complier error: hexdmp.cpp: In function `void output(unsigned char, int, bool&)': hexdmp.cpp:133: error: invalid types `unsigned char'...
3
by: Eric Mahurin | last post by:
Is there a standard way to get a descriptor object for an arbitrary object attribute - independent of whether it uses the descriptor/ property protocol or not. I want some kind of...
9
by: AG | last post by:
I occassionally get the following exception from an ASP.NET 2.0 Web Application running on a shared web host. I have no way of knowing what the actual request page was as it never happens when I...
2
by: paulablanca | last post by:
Hi! I have lots of problems here. I have here my codes for form validations and my problems are after submitting and there were errors, the page must be return to the index and retain it's values....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.