Questions tagged [jdbc]

11373 questions
1

votes
1

answer
218

Views

Kafka Connect JDBC Sink Connector

I am trying to write data from a topic (json data) into a MySql Database. I believe I want a JDBC Sink Connector. How do I configure the connector to map the json data in the topic to how to insert data into the database. The only documentation I can find is this. 'The sink connector requires knowl...
Chris
1

votes
1

answer
226

Views

ORM Who can generate script dynamically

So basically I was checking working of hibernate, as well evaluated ORMs JOOQ. JPA is main de-facto standard for all java based ORM implementations more or less. I am not saying they are not perfect or good but my problem is like I have found many issues and hick-ups while using various options prov...
1

votes
2

answer
43

Views

How to programmatically discover the JPA implementation and SQL dialect being used by Spring Boot?

I know it is possible to change the JPA implementation in use by Spring Boot, the default is to use Hibernate, but it's also possible to user others, like EclipseLink. It is possible to find, at application runtime, which JPA implementation is being used, and also discover which SQL dialect is curre...
André Shevantes
1

votes
2

answer
1.1k

Views

H2 determining if String value is numeric

This is my first time using H2 and I'm trying to select only the records that DO NOT have a numerical ID (e.g. H27384WK would be valid, but 398453 would not). After researching this online, I couldn't find any solutions for this and none of the functions mentioned here seem to be helpful. How could...
1

votes
2

answer
186

Views

java jdbc check if value exists before inserting into table

I'm working on a Java project and I've hit a wall regarding inserting values into my table. I wanted to have a check before inserting into this table to see if there were any duplicates. I've tried an executeUpdate with a resultset for executequery afterwards, but I'm getting 'java.sql.SQLException:...
Eddie
1

votes
2

answer
104

Views

Singleton Database Class for JDBC Pool using Apache Tomcat JDBC

I am trying to configure a singleton database class to allow connection pooling against Oracle XE 18c database using JDK8 and Tomcat7. I can not compile the source because of the following error: unreported exception SQLException; must be caught or declared to be thrown Class source code: package co...
M.E.
1

votes
2

answer
40

Views

Is it possible to insert row into the child table of FOREIGN KEY?

I have three tables in my database: COMPANY(ID, NAME) COUPON(ID, TITLE) COMPANY_COUPON(COMPANY_ID, COUPON_ID) Company can create coupons, so when it creates coupon, coupon's ID and ID of the company will be added into COMPANY_COUPON table. When company deletes coupon it also will be deleted fr...
Vladimir
1

votes
2

answer
140

Views

ElasticSearch - Failed to parse content to map - Unexpected character ('\"'

Wondering if you can help, I'm having issues with my code in Elasticsearch that is giving out an error. My code is below and the output is also below, any help is greatly appreciated. curl -X PUT 'localhost:9200/_mapping/jdbc' -H 'Content-Type: application/x-ndjson' -d ' { 'mappings': { 'jdbc' :...
Mark Staples
1

votes
1

answer
100

Views

JDBC CallableStatement - call multiple stored procedures in one shot

To call Oracle's stored procedure using only simple JDBC in Java we could do something like this: con.prepareCall('{ call ? = my_procedure(?) }'); callStm.registerOutParameter(1, Types.INTEGER); callStm.setInt(2, -100); callStm.execute() I want to know is it somehow possible to call more then one pr...
jsosnowski
0

votes
0

answer
5

Views

Using Slick with Kudu/Impala

Kudu tables can be accessed via Impala thus its jdbc driver. Thanks to that it is accessable via standard java/scala jdbc api. I was wondering if it is possible to use slick for it. Or if not is any other high level scala db framework supporting impla/kudu.
abalcerek
1

votes
3

answer
2.8k

Views

JDBC postgres vacuum timeout

I'm trying to vacuum my Postgres database by running the following SQL instruction within Java: vacuum verbose analyze Sometimes it just seems to 'hang' is there any clean way to abort the process? I have tried SET statement_timeout TO XXXX But I get the error message 'VACCUM cannot run inside the...
deltanovember
1

votes
2

answer
2.2k

Views

JUL to SLF4j with oracle jdbc driver

I am trying to redirect java.util.logging messages logged by the oracle jdbc driver and the oracle ucp (universal connection pool) library, but not able to do so. The messages logged by my application using JUL get logged but the ones logged by the oracle libraries are not getting logged. My intent...
Andy Dufresne
1

votes
3

answer
8.5k

Views

Returning Cursor in MySQL

How do we return a cursor from MySQL Stored Procedure (Routines). Or another approach to return a list of values back to a Java program from the MySQL Proc. We are trying to implement the similar functionality as Sys Ref Cursor in Oracle and looks like there is similar thing in MySQL. But wondering...
Java Guy
1

votes
0

answer
240

Views

Spring NamedParameterJdbcTemplate return empty list for oracle db

I had such problem: 'ORA-12705: Cannot access NLS data files or invalid environment' before. After reading different solution of this issue I added string Locale.setDefault(Locale.ENGLISH); to my DAO class method But now it returns empty list. Code of Dao class: public class StudentsDao { private...
AKS
1

votes
0

answer
48

Views

How to refresh vaadin table after altering data?

I have this vaadin table which i'm using to display and update records that are being stored in MySQL DB, it all works fine except for updating the table after making a modification or an update, I tried using Table.refreshRowCache() but that wasn't useful try{ Class.forName('com.mysql.jdbc.Driver')...
Bendaoud Achraf
1

votes
0

answer
50

Views

Determine cause of SQLConstraintViolationException

I am currently writing some code that works on updating values in a database. I have a table with three constrains: a primary key (composite), a foreign key (not composite), and a unique key (composite). My table (the output of show create table ItemAttributeMaster): CREATE TABLE `ItemAttributeMast...
vikarjramun
1

votes
2

answer
612

Views

Pushing down filter predicate in Spark JDBC Properties

How can I setup my spark jdbc options to make sure I push down a filter predicate to the database and not load everything first? I'm using spark 2.1. Can't get the right syntax to use and I know I can add a where clause after the load() but that would obviously load everything first. I'm trying the...
horatio1701d
1

votes
1

answer
781

Views

Spark Will Not Load Large MySql Table: Java Communications link failure - Timing Out

I'm trying to get a pretty large table from mysql so I can manipulate using spark/databricks. I can't get it to load into spark - I have tried taking smaller subsets, but even at the smallest reasonable unit, it still fails to load. I have tried playing with the wait_timeout and interactive_timeout...
1

votes
1

answer
21

Views

“out of range” error inserting mobile number from servlet to SQL

I am trying to insert mobile number through prepared satement, but I am getting an error stating that type out of range even for Double type. pstmt.setDouble(6, 9677627718); How to insert mobile number from servlet to sql? It says that out of range even for double data.
Bala
1

votes
0

answer
930

Views

Spring SimpleJdbcCall Oracle sql/pl - Unable to determine the correct call signature - multiple procedures/functions/signatures

I have a stored procedure in a package which has it defined with three different method signatures in the same package. They vary by only a few parameters (each calls the next with a few default values). I've over-simplified the list of columns for the sake of brevity here. I have about 55 fields...
Josh Hull
1

votes
0

answer
101

Views

JasperSoft Studio - How to handle DateTimeOffset

In SQLserver we have this type DateTimeOffset witch the only diferent with DateTime is that we have an Offset of the time zone. JasperSoft Studio (6.3.0 Final) don´t work with this type as you can see: java.lang.ClassNotFoundException: microsoft.sql.DateTimeOffset cannot be found by net.sf.jaspe...
Willas
1

votes
0

answer
48

Views

Android app doesn't login by error: org/postgresql/jdbc/TimestampUtils

when I try to do login in my android app occurs the following error: java.lang.VerifyError: org/postgresql/jdbc/TimestampUtils at org.postgresql.jdbc.PgConnection.(PgConnection.java:279) at org.postgresql.Driver.makeConnection(Driver.java:450) at org.postgresql.Driver.connect(Driver.java:252) at jav...
Mk14
1

votes
0

answer
143

Views

JDBC treat warnings as error on data truncation

I have a MySQL table with three fields: fname varchar(20) ftype varchar(10) value varchar(30) as you can see 'value' is a varchar, but I use it to store differente kind of value (entered by users), so I can do: UPDATE table SET value = 1 + value WHERE ftype='COUNTER'; it works as intended,...
moretti.fabio
1

votes
0

answer
215

Views

Using JBDC to read sql file in spark scala collecting Warehouse error

I am trying to read MySQL file using Spark Scala. Following is the code I tried val dataframe_mysql = sqlContext.read.format('jdbc') .option('url','jdbc:mysql://xx.xx.xx.xx:xx') .option('driver', 'com.mysql.jdbc.Driver') .option('dbtable', 'schema.xxxx') .option('user', 'xxxx').option('password', '...
Fouad Haddud
1

votes
0

answer
228

Views

Flyway GSS Authentication Failed Postgres Connection Error

When attempting to connect to our Postgres instance using Flyway, I get GSS Authentication failed connection error: Unable to obtain Jdbc connection from DataSource ( jdbc:postgresql://host/database? kerberosServerName=postgres& jaasApplicationName=pgjdbc ) for user '[email protected]': GSS Authe...
Brady Clifford
1

votes
1

answer
76

Views

Improve speed of insertion of big amount of data

I have a rest service that take xml with 400_000 records, each record contain the following fields: code,type,price. In DB (MySql )I have table named PriceData with 2_000_000 rows. The purpose of this rest is: select all PriceDatas from DB according to code,type from XML, replace price of each Price...
Almas Abdrazak
1

votes
0

answer
492

Views

How to change jdbc-connection-pool properties dynamically at glassfish-resources.xml?

Basically I have two enviroments which run my Application, I use the preconfigured Docker enviroment on AWS to deploy my applications. So, it gets the connection properties by the glassfish-resources.xml, with Glassfish 4.1.1, everytime I need to deploy a new version to any enviroment It is needed t...
Allan SM
1

votes
1

answer
98

Views

Select on Northwind database using JPA and JDBC Template

I would like to perform select statement on Northwind database like this bellow. select distinct b.*, a.CategoryName from Categories a inner join Products b on a.CategoryID = b.CategoryID where b.Discontinued = 'N' order by b.ProductName; I have two problems regarding this operation : I have crea...
jocom
1

votes
0

answer
307

Views

Connect to MySQL in RDS using Java Connector/J and SSL

I am struggling to get my java code (that uses HikariCP) to connect with my database on AWS RDS using SSL. I can connect with the database using MySQL Workbench, I just can't find out how to configure the MySQL Connector/J 5.1.45 driver to access the database using SSL. Currently this is my HikariCP...
mFeinstein
1

votes
1

answer
1.2k

Views

Can not connect to ZooKeeper/Hive from host to Sandbox Hortonworks HDP VM

I downloaded HDP-Sandbox (in an Oracle VirtualBox VM) a while ago, never used it much, and I’m now trying to access data from the outside world using Hive HDBC. I use hive-jdbc 1.2.2 from apache, which I got from mvnrepository, with all the dependencies in the classpath, or hortonworks JDBC got fr...
Sxilderik
1

votes
0

answer
413

Views

Connecting to Informix Connection Manager Using JDBC

I need some clarification on how (some) JDBC drivers connect to (Informix) Databases. We had the issue of 'connection refused' when trying to connect to Informix connection manager from a Java application via JDBC,although access was granted via firewall. When we consulted Informix Team,they told us...
selman
1

votes
1

answer
544

Views

How do I install mssql jdbc driver to confluent / kafka

I'm trying to create a connector through the rest and it won't work stating that 'Failed to find any class that implements Connector and which name matches com.microsoft.sqlserver.jdbc.SQLServerDriver I'm on ubuntu 16.04 and I've tried the following and each time i try something new i stop then sta...
matthewdaniel
1

votes
0

answer
49

Views

Java generics and reflection to create and set model for SimpleJdbcCall in Spring

I am trying to use reflection and generics to create models using SimpleJdbcCall. At the moment I have to create a distinct mapper per model that I add to the project. I would like to create a mapper that uses reflection to just simply map the model, so that I only have to write one mapper (in the m...
resu
1

votes
0

answer
308

Views

Relation “xxxx” does not exist

Can you tell me how to fix this exception from console? org.postgresql.util.PSQLException: ERROR: relation 'xxxx' does not exist This exception is for some tables in my project, and I don't know why. Application works fine without any issues. I have in resources import script dml and tables are fill...
Denis Stephanov
1

votes
1

answer
250

Views

Connect Oracle cloud DB in JAVA using SSH with Local port forward

I want to connect to an Oracle db in JAVA which hosted in cloud. I have server private key and remote details to connect. I can establish SSH connection to server with private key authentication and created SSH tunnel. Now using this tunnel, I can connect to remote server and forwarded session to lo...
Parthiban
1

votes
0

answer
65

Views

Data not inserted in ms sql database from android studio app

I had developed an android application connected with ms sql database when I try to insert data it does'n show any error but on sql data is not inserted. Please help me. I used androidstudio 3.0.1, Ms-sql R2 database, jtds 1.3.1.jar for jdbc connectivity. Please help me to insert data in the databas...
Fox star
1

votes
0

answer
335

Views

spring SQL Server Connection issues

I have migrated an existing ORM project to use SQL Server instead of MYSQL. I am using Java 8 and sqljdbc6.version - 6.2.0.jre8. I'm using maven and the reference is in the pom. I have connected to SQL Server in the past using 4.1 and I have the sqljdbc_auth.dll copied in locally. The application...
gringogordo
1

votes
0

answer
826

Views

Spring Boot / Oracle / Java error : Could not get JDBC Connection results in Connection timed out

The system I am working with has the following (I am using Spring Boot) I am getting an error when starting an application using the following: Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: `Could not get JDBC Connection`; nested exception is java.sql.SQLRecoverableException:...
Casey Harrils
1

votes
1

answer
47

Views

SQLITE JDBC driver prepared statement fails (internal pointer 0)

SQLite JDBC driver version 3.21.0 (the latest). Summary A prepared statement is opened for multiple insert operations on a table, but is unable to survive primary key violations. If one 'bad' insert fails due to a Primary Key violation, the prepared statement is unable to process subsequent 'good' i...
coulan88
1

votes
0

answer
167

Views

Hanging JDBC query with Impala

I am having a weird issue. I am building an automated testing A/B tool in order compare Impala to other sources. I have 100 queries I am trying to run, that run fine through other sources and within Impala through Hue. I try to run certain queries into Impala from Java and it hangs. I run same...
user434290

View additional questions