Questions tagged [jdbc]

JDBC (Java DataBase Connectivity) is the base API which enables interacting with SQL database servers by executing SQL statements using the Java programming language.

0
votes
0answers
4 views

Spring Boot Oracle Exadata | Connection Reset error

below is the application.properties file: spring.datasource.url=jdbc:oracle:thin:@asdf:1521/asdf spring.datasource.username=asdf spring.datasource.password=asdf spring.datasource.driver-class=oracle....
0
votes
0answers
10 views

JDBC Driver Jars Path for Seahorse Deepsense

As per the documentation from seahorse deepsense.ai, Custom JDBC connectivity can be achieved in 2 ways. Adding the JDBC jar library to cluster deployment. Adding JDBC driver JAR file to Seahorse ...
0
votes
1answer
11 views

How to regist hive udf before spark read table from jdbc

I created one UDF in hive, for example: create function mydb.level as 'com.my.udf.level' using jar 'hdfs://hadoop01:8020/user/hive/udf_jars/dbtools-1.0-SNAPSHOT.jar'; Now , I want to read data ...
-1
votes
1answer
19 views

Oracle Trigger: Insert into Transaction Entity New Row Upon Update, Insert of Account Entity

I'm a newbie to SQL and I'm having a real hard time setting up this trigger. It's for a Bank Console JDBC sort of thing. I have a schema with three entities, USER, ACCOUNT, and TRANSACTION. I want ...
1
vote
1answer
11 views

H2 database - how to init multiple schema (yml)

My conf (working): jdbc-url: jdbc:h2:mem:myDb;DB_CLOSE_DELAY=-1;INIT=CREATE SCHEMA IF NOT EXISTS MYSCHEMA_1 I need to init mulitple schema, but i can't find the syntax. So far I tried: jdbc-...
1
vote
1answer
9 views

jooq code generation mysql remote db maven

When I try to generate code against my remote DB, I keep getting some variation on the below: [ERROR] Failed to execute goal org.jooq:jooq-codegen-maven:3.11.5:generate (default) on project ...
0
votes
0answers
13 views

In Hibernate, how do I pass in date (without time) as a paramter to a CriteriaQuery?

I'm using Hibernate 5.2.12.Final with Java 8. I'm trying to build a query in which I pass in a date parameter. However, I only want to pass in the year, month, and day as part of the date param, not ...
-1
votes
0answers
10 views

Update query is not working in store procedure after EntityManager.find()

I am using JPA(entitymanager.find()) to get entity from database and in next method I am calling store procedure using callablestatement to update same record? but that does not get updated
0
votes
0answers
17 views

How to insert selected multiple checkbox values into sql server database using prepared statement?

<html> <head> <title>Welcome</title> </head> <body> <form action="First_prgm" method="post"> <table> <tr> <td> <b>3)Not including ...
0
votes
1answer
49 views

High CPU usage on insert to MySQL from Java

I am trying to write an array to mysql database, however this seems to put the cpu to 100% usage. public void add_data(double[] data) throws SQLException { PreparedStatement c = null; ...
0
votes
0answers
20 views

Connect Oracle SQL developer to Microsoft SQL server 2017

I recently installed Microsoft SQL server 2017 on my computer and I also installed Microsoft SQL Management Studio and everything seems to work pretty well. One of my colleague told me that I could ...
-1
votes
0answers
38 views

Handling of multiple errors with mysql JDBC Connection URL

We're trying to query MySQL databases in Java using JDBC .We have formulated a way to construct the JDBC connection URL based on the user input like username, password, DB name/SID, IP, port etc. This ...
0
votes
1answer
30 views

How to optimize inverted file for full text indexing?

I am making a simple program where I am using a sample of PDF files to build a full text indexing on my database. The idea is I read each PDF file, extract the words and store them in a hashset. ...
-1
votes
0answers
38 views

MsSql is very slow in JDBC

In MsSQL PreparedStatement is 10 times slower than createStatement. Sql planning holds too much. Is there any solve for slowness troubleshooting. Table has 14 million records. MsSql select profile ...
0
votes
1answer
16 views

spark jdbc api can't use built-in function

I want to get subquery from impala table as one dataset. Code like this: String subQuery ="(select to_timestamp(unix_timestamp(now())) as ts from my_table) t" Dataset<Row> ds = spark.read()....
0
votes
1answer
33 views

Difference in timestamps from Oracle through JDBC

I kept the dbtimezone in the Oracle DB(12.2) as '-07:00' and 'America/Los_Angeles' and retrieved a column with 'TIMESTAMP WITH LOCAL TIME ZONE' which gave me different values. It shows difference of 8 ...
-2
votes
3answers
36 views

How to check whether the image is stored in database or not from JAVA/JSP? [on hold]

I have column to save image. I have use "BLOB" type in database to store image. Now, I want to check whether the user submitted picture or not from JSP page. How can I achieve this? The previous ...
0
votes
1answer
16 views

Java JDBC program throwing SQL syntax error when fetching particular rows from a table

I have a database called 'airplane' inside which there is a table named timetable . The timeatable table has a column fromcity of text type Connection conn0=null; ...
0
votes
1answer
16 views

Class org.apache.hive.jdbc.HiveDriver not found

I am trying to access hive from my local machine using hivejdbc driver. but i am facing issues. i am using below code. not sure how to add jar to python. import jaydebeapi url = ("jdbc:hive2://" + "...
0
votes
0answers
9 views

Generic JDBC Update Snap error: Requested array size exceeds VM limit

When doing a simple update in PostgreSQL using the Generic JDBC Update snap, the pipeline is failing because of the following error. Following is the full stack trace. com.snaplogic.snap.api....
-2
votes
1answer
30 views

SQL query in JAVA program using JDBC throwing an error when trying to do SELECT operations

I have a MySQL database with the name airplane. Inside it there is a table named 'timetable'.this table is used for storing schedule of flights for an aircraft company it has five columns named id(...
-1
votes
0answers
17 views

result set object method getString/getInt cannot fetch data from mysql table [duplicate]

I'm trying to display specific data from the mysql php table in tableview in javafx. I get the exact error: java.sql.SQLException: Before start of result set at com.mysql.cj.jdbc.exceptions.SQLError....
-3
votes
0answers
23 views

jdbc.jar not found in netbeans [on hold]

I am new to java. When I try to implement the code in netbeans, it shows me this error: jdbc.jar not found
1
vote
2answers
26 views

Java JDBC throwing an error for an SQL query asking to return details from only particular rows

I have a database called 'airplane' inside which there is a table named booking. The booking table has the columns phone(int type) ,name(text type),address(text type),city(text type) destination(text ...
2
votes
1answer
36 views

server time zone value 'CDT' is unrecognized or represents more than one time zone

When trying to connect to a mySQL on my website I get this message java.sql.SQLException: The server time zone value 'CDT' is unrecognized or represents more than one time zone. You ...
1
vote
2answers
41 views

Return sequence number on insert

Upon inserting order into a HSQL database through my OrderDAO object, I want to be able to retrieve the sequence number that was assigned to order on insert. I have this for my PreparedStatement: ...
0
votes
0answers
21 views

Oracle ucp jdbc pool is not working in tomcat 6 to 8 upgrade

We were trying to create oracle datasource and connection pool through code. We are using the ojdbc6.jar Context ctx = null; Properties cacheProperties = new Properties(); System.out....
0
votes
0answers
31 views

beeline hive jdbc connection - User: user is not allowed to impersonate hiveuser

hiveserver2 is up and running and I can check it from http://localhost:10002/hiveserver2.jsp. hive is also running. after starting beeline >beeline i want to connect to hive JDBC through beeline: !...
1
vote
1answer
34 views

How to print the whole column from resultset?

I am trying to print the whole column from database using jdbc. Created a arraylist "searchRes". While running, I am just getting one row and not the whole column. if (resultSet.next()) { ...
2
votes
1answer
58 views

Speeding up a large number of SELECT queries which may or may not return a result

I have this query: "SELECT SECURITY_ID FROM " + securitiesTable + " WHERE (ISIN = ? or CUSIP = ? or SEDOL = ?)" I need to execute it about 50k times. Rows may have 1, 2, or all 3 of the values in ...
0
votes
0answers
10 views

Received exception while creating connection for pool. IO Error: Unknown host specified in weblogic server

java.sql.SQLRecoverableException: IO Error: Unknown host specified
0
votes
1answer
15 views

JDBC not registering metrics on spring boot 2 when @RefreshScope is on DataSource Bean

I have an application that uses spring boot 2 and logs metrics from micrometer. I want to log jdbc (mysql) min, max, and active connections periodically. I also want to use @RefreshScope on my ...
2
votes
2answers
36 views

JDBC Connection to SQL server with Dynamic TCP Ports

My sql server engine is using dynamic TCP port, e.g., 52358. I can do JDBC query without any problem if I specified the port number 52358 in my JDBC DB url connection string, i.e., jdbc:sqlserver://...
0
votes
0answers
20 views

JPA: Map Same POJO/Entity to multiple tables with same structure dynamically

I have a legacy database, where there are 3 tables with same table structure. I would like to know if there is a way in JPA/JDBC to map a single Entity/POJO to insert/read data to/from these tables? ...
1
vote
0answers
50 views

SQL time value between 0:00 and 00:59 set to 23:xx

I read the time of some employees postings from my database table. Time is stored as time (without timezone). Table CREATE TABLE "dba"."mytable" ( "id" INTEGER NOT NULL DEFAULT AUTOINCREMENT ...
0
votes
0answers
24 views

Java class. org.apache.beam.sdk.util.UserCodeException: java.sql.SQLException: Cannot create PoolableConnectionFactory

I am pulling data from Oracle using dataflow job in java. While running my dataflow job with a Direct runner, I am facing below error jsonPayload: { exception: "java.lang.RuntimeException: org....
0
votes
0answers
17 views

PreparedStatement executeBatch changes in Oracle12c vs Oracle11g [duplicate]

After upgrading Oracle database from 11g to 12c version, we started getting lot of errors at the hibernate layer Batch update returned unexpected row count from update [0]; actual row count: 0; ...
0
votes
1answer
36 views

SQL query in my JAVA program done using Prepared statement throwing error despite being correct [duplicate]

In my java programs , I am trying to do insertion ooperation in MySQL table using prepared statements . Here it my SQL query: PreparedStatement stmt = null; String sql="INSERT INTO registration"+"(...
-1
votes
0answers
16 views

inserting data into sql database from netbeans [duplicate]

When i run it i don`t understand why its not working,I checked each row but still there is a bug :( I didnt undertsand the error either.The error sent me in line the is(String name = textFieldName....
0
votes
0answers
26 views

How to use PostgreSQL Array with JDBC?

I'm try to use PostgreSQL Array of varchars with Hibernate Converter. My converter method @Override public Array convertToDatabaseColumn(List<String> attribute) { if (attribute == null) ...
0
votes
0answers
10 views

Can Oracle SQL Modeler Connect to a Physical MySQL (Localhost)

All, Is there is a way to connect Oracle SQL Modeler, to MySQL ? I can connect Oracle SQL Developer to mysql by going to Tools->Preferences ->Third Party JDBC Drivers -> pointing to mysql-connector-...
0
votes
0answers
16 views

NullPointerException upon trying to retrieve java.sql.Timestamp using JDBI's fluent API

I'm trying to retrieve a MAX(ymdh) from a Vertica table using the following. String query ="SELECT MAX(ymdh) AS ymdh_max FROM table_name"; VerticaDBUtil tjVerticaUtil = VerticaDBUtil....
0
votes
0answers
18 views

JDBC connection error while running SoapUI project using VSTS (azure-devops) [duplicate]

I am trying to run my SoapUI project using VSTS. For this i follow this article. Everything works fine except when JDBC connection required in my test case. Error : [error]java.lang....
0
votes
0answers
15 views

How to retrieve records from database in tabular format using jdbc?

I am writing a program to display all the records from the database using jdbc and servlet.I used the following query: select * from table_name; But it is all so messy. Is there a way to retrieve ...
0
votes
2answers
27 views

How do I get output or error stream for jdbc

I am trying to connect DB2 via JDBC. How do I get the output message that sql would have returned as like IDE. E.g Select query would return 100 rows were fetched. Insert would return the number of ...
0
votes
1answer
41 views

Inserting rows into a ResultSet without update method in Java JDBC

Q1: I have a loop inside which there is a select statement. Now I want to accumulate all these rows from select statement, into a ResultSet and then use it for other purpose outside the loop. How can ...
-5
votes
0answers
20 views

Can someone tell me solution for this Hibernate problem [closed]

This problem is showing whenever I am trying to run my hibernate problem. Please help me out with this problem ERROR: No suitable driver found for jdbc:oracle:thin:@localhost:1521:xe Exception in ...
0
votes
1answer
30 views

SSL Exception with MySQL when upgrading to Java JDK 11

I was trying to update my project SDK from JDK 10 to 11. However, when my program tries to connect to my MySQL server (currently hosted on my local machine) I get a javax.net.ssl.SSLException. I see ...
0
votes
2answers
30 views

Fetch rows in batches from a table/tables in guaranteed order in SQL Server 2016

I am creating a bulk load utility in java that will read rows from tables from source database and populate data in destination database as the destination database is empty. I started with select ...
-1
votes
0answers
8 views

Error while runnin g application for path not set despite the path being set [duplicate]

When I run the program using testpad and in command prompt the error comes as follows even after class path is set : Error: Could not find or load main class test How is this caused and how can I ...