Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The source attachment does not contain the source for the file SQLServerConnection.class

 
J. Howard
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get this message when executing an SQL Server database SELECT in the following code:

import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

...

try
{
SQL = "SELECT DATA_VALUE_STRING FROM dbo.MISCELLANEOUS_DATA_R " +
"WHERE DATA_NAME = LAST LOAD DATE TIME";
stmt = con.createStatement();
rs = stmt.executeQuery(SQL);
if (rs.next() ) {
rs.next();
Date lastRunDate = rs.getDate(1);
System.out.println(dataDateTime + "///" + lastRunDate);
}
}
catch(Exception e)
{
System.out.println("Error 5: " + e.getMessage() + " SQL: " + SQL);
System.exit(5);
}

The error occurs on the stmt = con.createStatement(); line.

This is the 5th database call in my program, and the preceeding 4 work fine. This code was copy & pasted from previously executed code, so it is exactly the same except for the SQL variable.

Any help would be greatly appreciated.

John
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi John, welcome to the Ranch!

I think I recognize that message, it comes from Eclipse. You didn't mention that you were using Eclipse, and that would have been useful information. And are you running your code in Debug mode? Because that message appears when the debugger tries to step into code for which you don't have the source. It doesn't particularly say anything about your actual code, not even that there's an error.
 
J. Howard
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct. I am using Eclipse, and the code runs fine when not in debug mode.

How can I fix this? I am a newbie, so please keep it as simple as possible.

Thanks,

John
 
Campbell Ritchie
Sheriff
Pie
Posts: 50241
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome again.

You do not need to fix that error at all. What it means is that you are using a class whose bytecode is available but not its text code. When you are debugging, Eclipse can show the original code and the line number where an Exception occurred. Much code is only supplied in .jar files, which only contain the bytecode, so that Exception information is not available.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic