SQL server agent (SQLEXPRESS) unable to start service - java

Could not start service for server agent, tried as local service,
Checked TCP-IP port and it is enabled,
I got connection refused while at net.sorceforge.jtds.jdbc.connection, the project is working on other environment,
Driver manager could not establish connection because of the service is unable start, any help or suggestion would be appreciated

Related

Issues with connecting to sql server db via linux

Im trying to execute a jar file from linux.The jar contains java code for connecting to sql server. When I try to execute the jar, Im getting the below error
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host servername, port 1433 has failed. Error: "null. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".
The connect properties file seems to have a valid username/password. I have checked the sql server configuration manager and the TCP/IP protocol is enabled. Im able to execute the same jar file in winodws and the sql server connection is established fine without any issues. Please let me know the steps I have to take to get this issue resolved.
Any help on this is much appreciated. Thanks

javax.naming.CommunicationException When enabling a firewall

I'm getting the following error when i'm trying to connect via RMI to a JBoss application
javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: org.jboss.proxy.ClientContainer]
This error occurs only after enabling IPtables on a linux server.
At the moment, we use this application as a logging tool between 2 servers, but it all Ports to be open because RMI uses random ports for the export of objects if i'm not mistaken
We have tested with some small test applications and the following is a viable solution when using firewalls with RMI:
UnicastRemoteObject.exportObject(server, 1244);
I export the object over port 1244
The following ports are open at this moment:
1244: The RMI-export object
1066: Binding with RMI on the server
1099: Registering on the management server
Is there anybody that could push me in the right direction to get this implementation working?
Thanks in advance!

SQLServer - SQLServerException with jdbc access

I have installed on my pc ms sqlserver express 2012, I am trying to reach it via jdbc but I am not successfull, I get the error:
com.microsoft.sqlserver.jdbc.SQLServerException: connection to the host localhost, port 1433 has failed. Error:
"Connection refused: connect. Verify the connection properties.
Make sure that an instance of SQL Server is running on the host
and accepting TCP/IP connections at the port. Make sure that TCP
connections to the port are not blocked by a firewall
I am accessing via the following url: "jdbc:sqlserver://localhost:1433;database=mytest;"
I enabled the tcp/ip via the Sql server configuration manager, but if I run netstat-an I can't see the 1433 port listening.
I disabled windows firewall too...
I am lost :(
Any help?
Thank you!
****UPDATE**
I could overcome the problem by enabling port 1433 on IpAll under Sql Server configuration manager - Sql Server Network configuration - Protocols for SQLEXPRESS - tcp-ip Properties - Ip Addresses. But now I get another error:com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'sa'. ClientConnectionId
Any ideas? thanks!
The answer for the error:
com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'sa'. ClientConnectionId
is:
Go to Object explorer, click on properties (right click on Sql Server name), and on the security tab click on Sql Server and Windows authentication mode.
This worked for me.

connecting to local MS SQL Server

I have a local MS SQL Server and I am trying to connect to it using JTDS in java. Here is the connection string:
Class.forName("net.sourceforge.jtds.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:jtds:sqlserver://localhost:1433/stock","sa","password");
And the server properties:
name: USER-PC\SQLEXPRESS
root directory: c:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL
I am getting a Exception in thread "main" java.sql.SQLException: Network error IOException: Connection refused: connect error.
How can I remedy this?
Check the following:
You have enabled mixed mode security, i.e. so you can connect with username/password (rather than using Windows authentication)
The TCP/IP protocol is enabled. Open SQL Server Configuration Manager, then in SQL Server Network config select Protocols and Enable TCP/IP.
Try passing just one String to getConnection using this format:
DriverManager.getConnection("jdbc:jtds:sqlserver://localhost:1433/stock;instance=SQLEXPRESS;user=sa;password=password")
If you are using this format (naming the instance) then the SQL Server Browser service needs to be running (in Services). If this is greyed out then the Service is probably disabled, so enable it and then start it.
Port 1433 is the port used by the default instance. You're using SQLEXPRESS, which is a named instance. Your connection string should include something like:
sqlserver://localhost\SQLEXPRESS
SQL Server Browser service is disable by default. If you're developing .Net app, you do not need to start SQLBrowser, but if you're using JTDS in java, you will need it started.

JavaDB wont start on App start, giving me a java.sql.SQLNonTransientConnectionException:

java.sql.SQLNonTransientConnectionException: java.net.ConnectException :
Error connecting to server localhost on port 1527 with message Connection refused: connect.
I am using Netbeans.
If I go to the Services Tab and rightclick Java DB and start Server it works fine.
How can I do this programmaticly at Runtime. I just need whatever method will start the Java DB Server.
Have a look at how to use JavaDB with a desktop application. They describe how to start it programmatically there.
You need to start the NetworkServerControl additional documentation can be found here
NetworkServerControl server = new NetworkServerControl(InetAddress.getByName("localhost"), port);

Categories

Resources