473,396 Members | 2,036 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,396 software developers and data experts.

jdbc connectivity

kaleeswaran
132 100+
hi!
i am started to connect jdbc driver with my java program..
i am using proper systax in my java program for connecting jdbc driver but i face the problem like this:
[Microsoft][ODBC Driver Manager] Invalid cursor stat..
this my java code:
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn = DriverManager.getConnection"jdbc:odbc:sample","kal eeswaran","kalees");
Statement stat = conn.createStatement();
ResultSet res = stat.executeQuery("Select * from customers");
ResultSetMetaData d=res.getMetaData();
int co=d.getColumnCount();
while(res.next());
{
for(int i=1;i<=co;i++)
{
System.out.println(res.getObject(i)+" ");
System.out.println();
}
conn.close();
}

i hope i am getting immediate reply,
thank you,
May 10 '07 #1
3 1114
dmjpro
2,476 2GB
do one thing .....

insert System.out.println(message) before and after the line .....
ResultSetMetaData d=res.getMetaData();

then tell me what prints and what not.......

and do one more thing ... check out the table whether it contains data or not.

best of luck
kind regards.
May 10 '07 #2
kaleeswaran
132 100+
Thank you for replay me!..
i found my mistake...
i was put a semicolon in my while statement that's the problem..
thank you,
May 10 '07 #3
dmjpro
2,476 2GB
that means exausted resultset causes this error.
May 10 '07 #4

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

Similar topics

0
by: Joe | last post by:
Hi, If I want to connect to a datasource on z/OS using the Universal Driver and use 2PC, do I have to craft the DB2 address url the Type 2 way? Can I use type 4 connectivity? Thx Joe
2
by: soup_or_power | last post by:
How do I configure the MS-SQLSERVER to accept JDBC connections and process the sql? I'm using SQLSERVER 2000 on Windows NT. Thanks for your help
0
by: om awasthi | last post by:
Hi... How can i do the jdbc and db2 connectivity
9
by: Roger | last post by:
Hi ! My dev team is getting this error when they run big load program : COM.ibm.db2.jdbc.DB2Exception: CLI0601E Invalid statement handle or statement is closed. SQLSTATE=S1000 .. The...
0
by: Bonna | last post by:
Hi there, A small challenge for all you 'DB2 Gurus' out there !!! I downloaded DB2 Express-C for XP Home from the following site : ...
3
by: %NAME% | last post by:
When using embedded SQL for db2 under solaris, you do not need to give username and password since the system will use your unix-login as default credential. However, with JDBC seems I always need...
2
kaleeswaran
by: kaleeswaran | last post by:
i creating registration form using jsp and i am usnig sun drivers.... i already posted my code into this forum but i could't get the proper result ... so please anyone send me the website address...
2
by: bevis | last post by:
I'm new to sql server and mysql but this seems like it should be a pretty straight forward jdbc connection. But I have spent almost 2 days just trying to get a jdbc connection. Please help if you...
3
by: Anoop | last post by:
Is it true that there are no type 4 jdbc drivers to connect to a DB2 server v7.1? The DB2 server is hosted on ACF2 (OS/390). We would be connecting from windows and solaris boxes. If it is true,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.