Tag: java

stored procedure returns just one row of multiple rows

I will start by giving you my table content This is my stored procedure: ALTER PROCEDURE dbo.getFoodsForOrder ( @orderID INT, @ID INT OUTPUT, @food_restaurantID INT OUTPUT, @count INT OUTPUT, @description VARCHAR(200) OUTPUT ) AS SET NOCOUNT ON BEGIN SELECT [ID], [food_restaurantID], [count], [description] FROM Order_Food WHERE orderID = @orderID END My Problem when I call […]

java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/db

This question already has an answer here: java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/dbname [duplicate] 9 answers

SQLServer connection with windows authentification in 32- and 64-bit environments

I have a Java Application which is distributed to a few users. The application connets to a SQLServer Database using windows authentification. From several SO-Posts (SO6938717, SO17277001) I learned that it is common practice to set a path to the needed library in the VM arguments. java -Djava.library.path=/path/to/my/dll -jar /my/classpath/goes/here MainClass My Application runs on […]

problem in inserting the value in the database

Hi i am developing the android application. I am using sql server 2008 R2 database to store the data and retrieve the data. Now when i am inserting the value in the database i am inserting 4 dates in the table. Here is the query: “INSERT Into Task_Master VALUES (‘1′,” + “” +userId+”,” +userId+ “,’N’,'” […]

Microsoft SQL Server no suitable driver

I started working today with the JDBC Microsoft SQL Server driver and I am always getting the error that no suitable driver has been found. Here is my code: /* try { Class.forName(“com.microsoft.sqlserver.jdbc.SQLServerDriver”); } catch (ClassNotFoundException e) { e.printStackTrace(); } */ String url = “jdbc:sqlserver://” + HOST + “:” + PORT + “;databaseName=” + DATABASE; […]

Sqoop “import-all-tables” unable to import all tables

this is the sqoop command which I am using to import data from SQL Server to Hive sqoop-import-all-tables –connect “jdbc:sqlserver://ip.ip.ip.ip\MIGERATIONSERVER;port=1433;username=sa;password=blablaq;database=sqlserverdb” –create-hive-table –hive-import –hive-database hivemtdb The problem is that sqlserverdb has about 100 tables but when i issue this command it is just importing 6 or 7 random tables to hive. This behavior is really strange […]

Need to improve performance query a table with millions of rows – SQL Server

This query on an audit trail table starts slowing down once the load increases in performance testing (reads and inserts) and I’ve done what I can with indexing. With this query and these tables and indexes, what more can I do? CREATE TABLE [dbo].[mod2] ( [id] [int] IDENTITY, [userId] [int] NOT NULL, [epochTime] [bigint] NOT […]

Persistence.createEntityManagerFactory takes ages

I have a DBUnit test which runs OK, but is taking ages (4-5 mins) to create the entity manager factory. I am using JPA with hibernate and SQL serve. Would be of great help if anybody could throw some light on this. My machine seems faster to blame it on Sql server 🙂 Here is […]

NetBeans Hibernate reverse engineering data types mismatch

I’m quite new to Hibernate since I’ve always used plain JDBC. I’m trying to configure the entities by using NetBeans’ reverse engineering process against a SQL Server database. I’ve followed the NetBeans’ webpage tutorial and I’m able to get a new package into my project with all entities created, but when I run this simple […]

How does the SQL Server JDBC Trusted Connection Authentication work?

How does the SQL Server JDBC Trusted Connection Authentication work? (ie how does the trusted connection authenticate the logged in AD user in such a transparent and elegant fashion and how can I implement a similar authentication solution for my client-server applications in Java without a database connection or any use of the existing SQL […]

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