Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ambiguous Statement?

Status
Not open for further replies.

chuq2001

Programmer
Jul 15, 2002
24
0
0
US
Here's my code

Statement stmt1 = connection.createStatement();

It causes error that says Statement is an Amgiguous Type.
It worked until I put the coded in an applet.
Any help

Thanks
Chuck T
 
Remove the word 'Statement' from your code, as you've already declared that statement above.
 
somewhere else you probably imported a different object that is also called Statement ( something I've got here aswell ) so java doesn't know which type you want.
ie:

import java.sql.Statement;
import mycode.something.Statement;

public void aMethod()
{
Statement stat = new Statement();
}

This example for instance gives the same error.
The correct syntax should be:

public void aMethod()
{
mycode.something.Statement stat = new
mycode.something.Statement();
}

or in your case:

....
java.sql.Statememtn stmt1 = con.CreateStatement();
....

Kris Simonis
Topdesk Information Systems

"You haven't seen the last of Meeaaaarrrrghh!!!"
- Several bad guys in several bad movies

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top