product: crystal reports enterprise version 9
Web server: AIX, websphere (I think)
web viewer: Java 1.3.1
Database: Oracle 9i
I am trying to run a Crystal rpt from a Java app, and connect to an Oracle database. I can run the report from Crystal, but when I try to run the java app, I get these messages:
url jdbc:oracle:thin:@10.100.10.94:8080:txcompd
sql exception Io exception: Got minus one from a read call
in main reportname
after appserver
after open
Problem-->SQL server logon failed.
I am new to Java and Crystal Reports. Here is part of my code: THank you!
String driverName = "oracle.jdbc.driver.OracleDriver";
// String driverName = "com.ms.jdbc.odbc.JdbcOdbcDriver" ; //ms jvm
// String driverName = "sun.jdbc.odbc.JdbcOdbcDriver"; //sun jvm
Class.forName(driverName);
// Create a connection to the database
String serverName = "10.100.10.94";
//where,ServerName has to be picked up from the form field (ServerName).Eg: 127.0.0.1
String portNumber = "8080"; // was 8080 / 1521
//Port Number has to be picked up from the form field (Port Number) Eg.:8080
String sid = "txcompd";
//Database name has to be picked up from the form field (Database Name) Eg.

B2
String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid;
System.out.println(" url " + url);
String username = "txcomp";
String password = "txcomp";
connection = DriverManager.getConnection(url, username, password);
System.out.println("after get connection");
} catch (ClassNotFoundException e) {
// Could not find the database driver
System.out.println("can't find database driver " + e.getMessage());
} catch (SQLException e) {
// sql exception
System.out.println("sql exception " + e.getMessage());
}
// String reportname = "C:\\Program Files\\Crystal Decisions\\Report Application Server 9\\Reports\\Product Catalog.rpt";
String reportname = "C:\\Program Files\\Crystal Decisions\\Report Application Server 9\\Reports\\participantNoParms.rpt";
System.out.println("in main reportname");
CrystalExport reporttest = new CrystalExport();
// CrystalExport reporttest = new CrystalExport();
InputStream attachment = reporttest.export(reportname);
System.out.println("after export call");
reporttest.sendEmail(attachment);
}
catch(Exception exception)
{
System.out.println("Problem-->" + exception.getMessage());
}
}