Skip to Content
author's profile photo Former Member
Former Member

jdbc.SQLServerException: Login failed for user 'XXXX'

I have converted a report from ODBC to JDBC with the designer.

Now when I run the report I get the the following exception:

com.crystaldecisions.sdk.occa.report.lib.ReportSDKLogonException: Logon Error: Login failed for user 'KIDSUSER'.---- Error code:-2147217393 Error code name:dbLogonFailed

Which is cause by:

com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'KIDSUSER'.

The preview works just fine in designer(And in Eclipse.)

Here is the code I'm using to generate my Report.

ReportClientDocument report = new ReportClientDocument();        report.setReportAppServer(report.inprocConnectionString);//getReportFileName() gets a passed in .rpt file from the file system.    report.open(Report.class.getResource(getReportFileName()).getFile().replace("%20"," "),                  OpenReportOptions._openAsReadOnly);ParameterFieldController reportParameters = report.getDataDefController()                                                        .getParameterFieldController();// report parameters get set here.ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream) report                                               .getPrintOutputController().export(ReportExportFormat.PDF);Response response = RequestCycle.get().getResponse(); response.reset();ArrayList<Byte> ByteMe = new ArrayList<Byte>(1024);int read;while ( (read = byteArrayInputStream.read()) != -1 ){ ByteMe.add((byte)read); }byte[] byteArray = new byte[ByteMe.size()];            for(int i = 0; i < ByteMe.size(); ++i) { byteArray[i] = ByteMe.get(i); }    response.getOutputStream().flush();response.getOutputStream().close();    report.close();            return byteArray; //passes it back to the framework to be sent to the user as a pdf file.
Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on May 06, 2012 at 11:51 PM

    I don't see anywhere in this code where the DB logon could be affected.

    This might sound obvious but, are you sure you copied the new version of the report in the filesystem folder used with this script?

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Actually I managed to Solve it myself.

      I ended up doing this:

      DatabaseController controller = report.getDatabaseController(); controller.logon("usernameHere","passwordHere");  for ( Iterator it = report.getDatabase().getTables().iterator(); it.hasNext(); ){   ITable table = it.next();    boolean connected = controller.verifyTableConnectivity(table);    String conn = "Connected ";          if ( !connected ) { conn = "NOT " + conn; }   conn += "To : " + table.getName();   log.error(conn);} 

      @Anchel I'm using SetDataSourceLocation in Designer to change it in the report file. I'm currently still using the same DB Server and database.

      (eventually I will be changing servers though.)

      Thanks for the suggestions

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.