Tag: java

Insert statement with subquery and extra column

I want to use insert statement with select subquery from another table. In my case, I want to add a row from PRESENTATION table to AVAILABILITY table. AVAILABILITY table structure: availableID (number, generated using sequence) availableDay (varchar) availableStart (varchar) availableEnd (varchar) lecturerID(FK) (varchar) presentationID(FK) (number, generated using sequence) PRESENTATION table structure: presentationID (number, generated using […]

How to store and retrieve text data in a formatted way?

I am building my website using Java and the SQL Server database. It is just like Stack Overflow where I have to store questions, answers, comments and images. I am not able to store the text in a formatted way in SQL Server’s text data type. Neither I am able to display it in a formatted […]

Can't access Sql Server from remote PC

I am working on Screenshare using Red5. I have a servlet that gets and displays clients sharing screen from Sql Server using ResultSet. My Pc acts as the Sql server and am able to display the table using servlet in my red5 server. But the servlet in red5 server in another PC which is connected […]

I receive a Error says , ‘Unable to find JDBC driver.’ error when using the Database Toolbox 3.9 (R2015a) to connect to an SQL Server database?

I have created a database connection in MS SQL Server Management Studio. And i am trying to connect MS SQL with MATLAB. Given below the code which i tried to connect it. And i receive an error says Unable to find JDBC driver. function [Out, Settings] = MSSQLconn(dbname, userpassmethod, varargin) % MSSQLCONN Establishes connection with […]

java sql column insert

I created a table with column actual & Predicted I inserted a Array of size 220 into column in table using SQL & JAVA st.execute(“insert into host_1 (actual) values (‘”+ac[j]+”‘)”); Now i try to insert predicted value st.executeUpdate(“insert into host_1 (exp_predict) values (‘”+pre[i]+”‘)”); It get inserted from 221th row. I want it to be inserted […]

override identitycolumn hibernate mssql

I have to manage a Datatransfer between 2 DBs (mssql) with hibernate. When i load an object from one DB with session.get() it already has a private key. Then i need to persist it to the other DB with anotherSession.replicate(Object o). My Problem ist, that the given PK is not persisted but replaced by another […]

java.sql.SQLException: Internal error when parsing callable statement metadata (missing parameter type)

For nearly 2 hours now I’m looking for a solution, but can’t find one … I’m getting this error and I can’t find where it comes from, it’s driving me crazy. Can you guys help me ? The error : java.sql.SQLException: Internal error when parsing callable statement metadata (missing parameter type) And the part of […]

JPA query for table with name user with Hibernate

I try to build a findAll query for a class with name User. With Hibernate’s SessionFactory it is working fine, but with Hibernate’s EntityManager I get an error. The reason seems to be the escaping (with brackets [and ]) of the MS SQL Server keyword user, but with EntityManager#persist(Object) and EntityManager#find(Class, Object) I have no […]

Using Java to Export Binary Data from SQL Server

I have a database table with 7500 records in it. I am trying to write something that can export all 7500 jpg images to a folder on my laptop and name them based on EMPID + TYPE. So the blob would be named 1008421_0.jpg for the first row I was thinking something like this but […]

How save old ID from MSSQL when insert entity to new DB ORACLE?

I write DB migrate utilite. I have MSSQL DB. Some tables. There are many rows in each table. I have empty Oracle DB. I have entities for tables. I create 2 conections. to MSSQL and to ORACLE. I create 2 DAO In 1 DAO I get all data from MSSQL List<Payment> payments = PaymentService.me().getPayments(); After […]

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