473,785 Members | 2,789 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

jdbc connectivity

kaleeswaran
132 New Member
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.J dbcOdbcDriver") ;
Connection conn = DriverManager.g etConnection"jd bc:odbc:sample" ,"kaleeswaran", "kalees");
Statement stat = conn.createStat ement();
ResultSet res = stat.executeQue ry("Select * from customers");
ResultSetMetaDa ta d=res.getMetaDa ta();
int co=d.getColumnC ount();
while(res.next( ));
{
for(int i=1;i<=co;i++)
{
System.out.prin tln(res.getObje ct(i)+" ");
System.out.prin tln();
}
conn.close();
}

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

insert System.out.prin tln(message) before and after the line .....
ResultSetMetaDa ta d=res.getMetaDa ta();

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 New Member
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 Top Contributor
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
1075
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
1576
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
847
by: om awasthi | last post by:
Hi... How can i do the jdbc and db2 connectivity
9
8859
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 application runs fine when they run small loads. I checked the Db2 client FP..its on DV2 V8 FP10. Any input is greatly appreciated.
0
1421
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 : http://www-306.ibm.com/software/data/db2/express/download.html. I was able to install it without any probelm, but then had problem creating the 'Sample' database using 'First Steps' option. Found the solution below :
3
10279
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 to provide username and password, the Java API DriverManger.getConnection(String url) does not work. I am not sure if this is because the JDBC driver, or because it does not work for DB2 under solaris. Any comments? Thanks a lot!
2
1316
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 regarding jsp with jdbc connectivity using sun driver.. thank you,
2
4559
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 can. I'm using Eclipse 3.2.2 and I have installed mysql-connector-java-5.0.6-bin.jar. I am trying to connect to SQL Enterprise Manager version 8.0 innstall on a Windows 2003 Server Enterprise Edition. I have been able to successfully test...
3
22839
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, what are my options? Will I have to install db2 connect on every client machine that needs to connect to the DB2 servers? Is the DB2 Connect freely available or will we have to purchase it? I have also read on this group that we can install DB2...
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10327
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10151
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9950
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3647
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.