Bom dia, estou com erro na geração de relatório com iReport no NetBeans e banco de dados SQLServer 2008.
A aplicação roda normalmente, com seus métodos de alteração, exclusão, inserção, mas ao gerar o relatório dá o erro no final da mensagem.
Já configurei o SQLServer com a porta 1433 e liberei no firewall, pois acesso o banco no servidor.
/*
* Uma fabrica de conexoes.
* @author David Buzatto (help)
*/
package iReport;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class ConnectionFactory {
static {
try {
Class.forName( "com.microsoft.sqlserver.jdbc.SQLServerDriver" );
} catch ( ClassNotFoundException exc ) {
exc.printStackTrace();
}
}
public static Connection getConnection(
String url,
String usuario,
String senha ) throws SQLException {
return DriverManager.getConnection( url, usuario, senha );
}
public static Connection getUniocupsystemConnection() throws SQLException {
return getConnection("jdbc:sqlserver://192.168.0.107:1433/UniOcupSystem","usuario","senha");
}
}
InputStream inputStream = getClass().getResourceAsStream
("/iReport/RelatorioAcidente.jasper");
Map parametros = new HashMap();
try {
ReportUtils.openReport("Acidente", inputStream, parametros,
ConnectionFactory.getUniocupsystemConnection());
}
catch(SQLException exc){
exc.printStackTrace();
}
catch (JRException exc){
exc.printStackTrace();
}
}
ERRO:
com.microsoft.sqlserver.jdbc.SQLServerException: The port number 1433/UniOcupSystem is not valid.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:170)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:580)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:841)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at iReport.ConnectionFactory.getConnection(ConnectionFactory.java:31)
at iReport.ConnectionFactory.getUniocupsystemConnection(ConnectionFactory.java:35)
at telas.Principal.RelatórioAcidentesActionPerformed(Principal.java:525)
at telas.Principal.access$2800(Principal.java:17)
at telas.Principal$29.actionPerformed(Principal.java:371)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1223)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1264)
at java.awt.Component.processMouseEvent(Component.java:6267)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6032)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

