This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help with a error

 
ben riches
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have this code.
but when i put it into my visual compostion, it brings up an error what says: (The type Connection is ambiguous).
can someone tell what this means please.
String data = "jdbc dbc:myProject";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn = DriverManager.getConnection(data,"","");
PreparedStatement pstmt = conn.prepareStatement("INSERT INTO Cust VALUES (?, ?)");
 
Braj Prasad
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would have another package with the same class name as Connection being imported.
try referring it by the explicit package name:ie. java.sql.Connection = ....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic