This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes unable to run the code. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "unable to run the code." Watch "unable to run the code." New topic

unable to run the code.

Jigeshs Shahs

Joined: May 28, 2009
Posts: 26
unable to run this code and cant figure out why???
please to JDBC

code compiles correctly but doesnt run properly

databsase structure
id ->number
name--> varchar
pwd -->varchar

Connection c = DriverManager.getConnection("jdbcdbc:stud");
s = c.createStatement();

int b;

ResultSet rs=s.executeQuery("select * from abc");

ResultSetMetaData rsm=rs.getMetaData();

int col=rsm.getColumnCount();


ta.append(rs.getString(b).trim()+ "\t\t");


catch(Exception d)

Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2904

Jigeshs Shahs wrote:unable to run this code and cant figure out why???
code compiles correctly but doesnt run properly

I didn't look at your code, because its not properly quoted using CODE tag.
And telling "it doesn't run properly" convey nothing, have a look at this for what I want to say.

[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 44048
Read this. Tell us what happens, otherwise we can't help you.
Jigeshs Shahs

Joined: May 28, 2009
Posts: 26
the code compiles fine but throws a runtime exception.
it connects to the database properly...
the only problem I see here is when its extracts the data from ResultSetMetaData.
i ve marked that code "red" where its showing error...
so if anybody has any idea........please help
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42958
Unfortunately we can't see your desktop remotely, so you'll have to tell us the error message you're getting, complete with stack trace.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: unable to run the code.
It's not a secret anymore!