Tag: java

How to reduce hang time of failed DB connection

I have a java web application that connects to a MSSQL 2005 database using Hibernate. As the connnection to the DB from my application is not critical I wanted to test how the application behaved when the database was unavailable. When I stop the SQL services and run through a part of the web application […]

Invalid string or buffer Length Exception in Java EE web application

I am quite new to Java programming and I am currently developing my first web application using the MVC Architecture. But I am encountering quite a lot of problems with my Application and I don’t have a clue why they are occurring. For instance I have the following code in my JSP page: Connection connection […]

Java, SQL Database Connection

I am C# developer and I don’t know much about Java, normally in C# when I wanna connect to a database I use the following command: static SqlConnection cn = new SqlConnection(@”Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True”); I read a tutorial about making database connection (Sql Server 2008) in java in MSDN saying that the address must […]

Cannot get result set after reading output parameters

I am using java to access mssql 2012 DB I have a stored procedure “procX” with takes only 1, (say named as @p1) in parameter and returns a single result set. It works fine unless I try to read the return value before I get the result set. Code is below. If I remove “//” […]

Sql Server Reporting Service 2010 WITH JAVA ee application

I am trying to integrate Sql Server Reporting Service with Java EE application. I can see 2 reports on the reporting server. I am trying to use the RS web service to access the server. Steps taken by me are Created Dynamic project in Eclipse Got to New – Web Service client and entered the […]

SQL connection exception

The below error throwing while connecting sqlserver(java). I don’t know root cause of this problem. CONNECTION URL :: jdbc:jtds:sqlserver://<IP>:<port>/DB2011;instance=TESTINST Caused by: java.sql.SQLException: I/O Error: Connection reset at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2277) at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:599) at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:331) at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50) at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:178) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) If anyone face this problem, kindly let us know, how can solve this […]

Android: HttpPost – Trying to insert data entered by a user into an SQL table on the server

I’m working on an android project and I’m trying to get the text that a user enters in an EditText box and add it into an SQL table on my server. I think the problem is coming from not having the correct SQL query but I’m not sure what it is I have to add […]

JDBC connection in JSP :java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc

Here i am trying to connect with Database through JDBC. Here is my code and ended up with the below exception. <%@ page import =”java.sql.*” %> <%@ page import =”javax.sql.*” %> <% Connection con = null; String url = “jdbc:jtds:sqlserver://192.168.0.123:4070/”; String db = “RUTHER_FORD”; String driver = “net.sourceforge.jtds.jdbc.Driver”; String userName =”RUTHER”; String password=”SORRY_CONFIDENTIAL”; int sumcount=0; […]

Urls in database

We have a little problem with Apache Shiro. We are using Shiro with a JDBC realm: users, roles, and permissions are stocked in our SQL server database. We have a java application used as a backoffice to insert, update or delete users, roles and permissions. But we need to do the same with Urls filters. […]

Log4J – SQL Data Truncation

im having this problem in Java using Log4j to logg to a SQL Server Database. It is usually thrown when you try to insert data into a column exceeding its size or limit, but unfortunately this is not my case. It logs perfect for some seconds and then… Boom! (Failed to execute SQL – Data […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.