Questions tagged [jdbc]

2

votes
0

answer
34

Views

RowSet Implementation in Google App Engine

I'm trying to use some existing code on Google App Engine, and it appears that there's a problem with my use of the CachedRowSetImpl class. I don't see this class in the JRE Class White List. Does anyone know where to get a CachedRowSet implementation when running in the GAE? In Java 7 there is the...
Andy King
2

votes
0

answer
306

Views

General questions about JavaEE security and JDBC realm authentication with WildFly 8.2

I'm studying chapters 47...50 of the JavaEE 7 tutorial about security, authentication, realms... Server managed authentication is totally new to me, so please be patient. I created my own JDBC realm (using WildFly 8.2) as described at paragraph 50.3 and with the help of this beautiful article. I ha...
Luigi Cortese
2

votes
0

answer
317

Views

How to display image from hive binary field using hive jdbc

I want to load and display image from hive binary field which was stored as binary from SQL Server Image field. I have tried with couple of ways to solve this as follows Extracting binary data from hive jdbc resultset as a string: Query: select image from table_4 where imageId=12; String image=res.g...
Pavan Kumar Varma
2

votes
0

answer
8.6k

Views

Connecting to SQL Server with Netbeans 7.1.2

I'm attempting to connect to SQLServer 2008 with the database connection wizard in netbeans. I already downloaded the jdbc and linked it to the .jar file, but it still won't connect. My fields seem to contain the right information.
UserX
2

votes
0

answer
59

Views

How to properly wire together readers and writers for PostgreSQL COPY?

I'm trying to use PostgreSQL COPY command to import data without creating temporary files. Initial data is in a format that requires conversion so I have something like this: void itemsToCsv(String filename, Writer writer) { /* Start processing */ CSVPrinter printer = new CSVPrinter(writer, CSVForma...
synapse
2

votes
0

answer
536

Views

BIRT Report not connected with sql server jdbc 4.0

When I deployed sample test report in apache tomcat 7.0.67, it was running correctly and another report connected with SQL server 2012. Report design preview is also working. BIRT report design manage driver, jdbc driver have been added and test connection found ok. sqljdbc4.0.jar has been added to...
Srinivasan B
4

votes
0

answer
224

Views

MySQL JDBC Connector Error

I'm using the latest MySQL version ... in my java application with named pipe and I started receiving the following error like 20 times in a row: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ag...
John
3

votes
0

answer
413

Views

ClickHouse spring jpa hibernate support

I am using Spring JPA with hibernate ORM project and want to integrate with ClickHouse. I found some references of ClickHouse JDBC which is working ClickHouseJDBCDemo ClickHouseJDBCDemo but was keen to know if there any better way to interact with database from Spring JPA like any ORM tool like Hi...
Shiva Achari
3

votes
0

answer
854

Views

Wrong value returned by the ResultSet for Oracle database

I am facing a strange issue with JDBC such that the value of a numeric and date field in the DB is different from the value returned by the ResultSet. I have the following row in the database (showing only 3 columns related to the question) J_ID J_DATE J_AMOUNT 1 29-JAN-...
Ping
2

votes
0

answer
164

Views

JDBC dialect when writing Spark to Hive

I am trying to write a dataframe from Spark 2.2.0 to Hive 2.1 through a JDBC connection. I know this is not the recommended way and that a direct connection using hive-site.xml should be configured but that is not an option for me currently due to factors outside of my control...so I'm stuck with JD...
Rob
2

votes
0

answer
541

Views

MySQL replication with ReplicationDriver : How does connection pool work?

I am wondering how Connection objects maintain connections with master-slave hosts when ReplicationDriver is used with a connection pool library such as DBCP. As for my understanding (please refer to the following image) , in the normal JDBC case , Connection object keep an TCP connection to the db-...
2

votes
0

answer
1.3k

Views

Spring transaction not rolling back due to closed connection

I have a pretty large transaction, annotated with @Transactional. There are a few long-running queries in it, but usually runs fine. About 20% of the time the Connection appears to be getting forcibly closed outside of the transaction, and when the transaction tries to continue doing work, it fails...
Michael
2

votes
0

answer
2k

Views

quartz scheduler db lock obtaining issue while on a 2 node cluster

We have implemented Quartz Scheduler 2.2.1 using Spring 4.0.5 . The application starts up fine in a single node , however whenever we try to deploy it to a 2 node cluster , it just hangs while trying to connect to the DB and then the server rolls back the deployment to both of the nodes. It is inter...
Kaustav
3

votes
0

answer
159

Views

Stored procedure returns wrong values with jdbc driver

I'm having a strange situation on a Stored Procedure on my MSSQL Server when executed via a jdbc driver. I have tried jtds and microsoft jdbc with the same results. I have other SPs that work perfectly but on this one, there is a strange situation. Here is the content of the SP: select b.columnA, co...
valter.vx
2

votes
0

answer
126

Views

How to get java Class object according JDBCType

I'm trying to implement data transfer from one DB type to another via JDBC. With connection.getMetaData().getColumnType() I can get JDBCType of column. How can I use it to get java Class object to be able to use resultSet.getObject(i, XXX.class)? Of course I can do something like this https://stack...
Mike
2

votes
0

answer
1.2k

Views

Spring integration jdbc message store performance

I was using the SimpleMessageStore ( memory ) as the default Store for an Aggregator, but as i need persistent store, i started using a jdbc solution backed up by Mysql 5.5 But i'm really concerned about its performance, as using a PerfTest ( databene's contiperf ), memory store achieved up to 6000...
josete
2

votes
0

answer
223

Views

Elasticsearch completion suggester phrase instead of terms

I am developing a search engine with Elasticsearch 1.6 and it's all working great. I get the data from my MySQL database with the JDBC importer from Jorg Prante. I would like to use the Elasticsearch complete suggester like documented here. The problem is only that I cannot find out how to do this w...
Sgarz
2

votes
0

answer
492

Views

Use of jTDS to connect to SQL Server 2012 throws IOException; MS SQL Driver works

The following code using jTDS driver (1.3.1): DriverManager.getConnection('jdbc:jtds:sqlserver://anIpAddress;databaseName=aDatabase', 'user', 'pass') results in: java.sql.SQLException: I/O Error: DB server closed connection. at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2481) at net.so...
James
3

votes
0

answer
805

Views

connect to mysql via spark jdbc connector

Hey I have an EMR cluster with spark 1.5.0 installed on it. I'm trying to connect to one of our table in RDS and pull some data. I downloaded the latest jar file from the official mysql site (http://dev.mysql.com/downloads/connector/j/) I downloaded and untarred the file put it /home/hadoop/connect...
Lior Baber
2

votes
0

answer
3.8k

Views

WARNING Failed to register in JMX: javax.naming.NamingException - tomcat dbcp2

I am using apache-tomcat-6.0.35 and upgraded DB Pooling Jar to commons-dbcp2-2.1.1.jar and commons-pool2-2.4.2.jar I made following changes in apache-tomcat-6.0.35/conf/context.xml file I have noticed following warning and info messages in tomcat catalina.out file when I add factory='org.apache.comm...
Jatin
0

votes
0

answer
514

Views

Create multiple connection pools dynamically

I am connecting with multiple datasources i.e. Hive, Oracle, Netezza, etc via JDBC and performing some DDL and DML queries. I tried multiple tools for connection pooling. I started with HikariCP1 (because it's still active), but got some issue with hive (needed hive 2.0.0 jar). So, I tried c3p0 and...
dev ツ
1

votes
0

answer
424

Views

Spring JDBC pool connection always max

We have a problem on a production server, this server is querying an external database (Postgresql) We have set the Max pool size to 20 and min pool size to 5, but we have always 20 open connection on Postgresql server even if it does not require that much connection, and almost all connexions are i...
Alkalyne
0

votes
0

answer
186

Views

JSF Web Application Cannot View Database Table

I am using the NetBeans 8.0.2 IDE with GlassFish 4.1. I have a JSF web application AddressBook (from Deitel and Deitel Java How to Program 9th Edition, Section 30.2) which has a Java Bean which accesses a database 'addressbook' with following code: // allow the server to inject the DataSource @Resou...
jisteinberg
0

votes
0

answer
902

Views

JDBC driver version for Oracle 12c

What is the suitable driver version to connect Oracle 12c. My java version is 1.6. Currently I am using Oracle 11G with ojdbc6-11.2.0.4.0 for JDBC connectivity. Now I am upgrading to Oracle latest version. So I want to know which version of jdbc driver is suitable for connectivity
Dharisi Suresh
2

votes
0

answer
298

Views

mysql-connector-java update from 5 to 6 causes a timeshift

In our java(1.8) / hibernate(4.3.2) / mysql (5.6.29-76.2) application we are using mysql-connector-java 5.1.40. Timezones for all servers(java, mysql) is UTC. When in the application we were inserting some datetimes '2016-10-26 08:00:00' into the DB, they were saved correctly as '2016-10-26 08:00:0...
Dmitrii Semenov
2

votes
0

answer
276

Views

How to specify JDBC request parameter values for OracleTypes.ARRAY in JMeter?

I need to use callable statement to call an Oracle stored procedure. The input is OracleTypes.ARRAY. My question is, how do I specify parameter values for this array? I've tried these formats: {a, b} [a,b] (a,b) none of them work. Unfortunately, there is no example in the documentation http://jm...
Little Monkey
2

votes
0

answer
391

Views

java missing class when supervisor running process but not when running as www-data user

I've made my first clojure app and I've built it with leiningen by running lein ring uberjar. I can run this on my dev machine (fedora 23) and I can run this on my ubuntu production machine java -jar tomahawk.jar. I've followed the digital ocean tutorial here that describes how to set up the environ...
dpsutton
2

votes
0

answer
870

Views

HSQLDB “Unknown JDBC escape sequence” in CallableStatement

I am using SpringMVC and I have some issues with a HSQLDB and a CallableStatement used like this: Java code String call = '{ ? = call MY_FUNCTION(?,?) }'; CallableStatement statement = connection.prepareCall(call); Exception It throws the following exception: java.sql.SQLException: Unknown JDBC esca...
span
2

votes
0

answer
821

Views

Too many data type queries on creating persistent manager with datanucleus

We found the performance of connecting to a remote postgres database is very bad with datanucleus and postgresql jdbc. The reason is there are many queries generated to query the data type table: pg_catalog.pg_type. We wrote a small program as follows and added datanucleus, JDO & postgres jdbc jars...
user1057071
3

votes
0

answer
38

Views

Why realm is required for some users in beeline connection,even its ensured with ldap authentciation.?

Problem: Why realm is required for some users in beeline connection,even its ensured with ldap authentciation.? While connecting with beeline,with configured ldap authentication some users connected with without realm and some users connect with realm authentication.This is because of while creating...
mathes
0

votes
0

answer
84

Views

Spring + Hibernate DBCP long transaction JDBC Commit Failed

i have an production issue regarding Spring + Hibernate application that keep throwing JDBC Commit Failed in certain of time (intermittent, sometime it take a month, but sometimes 2-4 times a month to get this error). i don't know how to reproduce the issue. i'm using Oracle database, Hibernate Fram...
dibrut
0

votes
0

answer
260

Views

How do I connect to a remote servers MySQL database using Java?

Currently I have written a program to populate a mysql database on my own computer and I connect to it using JDBC using: Connection conn = DriverManager.getConnection( 'jdbc:mysql://localhost:3306/data?useSSL=false', 'root', 'your_new_password'); // MySQL // Step 2: Allocate a 'Statement' object in...
Programmer
0

votes
0

answer
131

Views

After multiple successful request jdbc connection breaks

So REST service works fine, but after multiple requests (around 10) I get an error on next request. Can anyone help I have no idea what to do? EDIT: 9 requests are successful but 10th and every other are not. Error message: 2018-06-22 01:52:56.892 ERROR 1716 --- [nio-8080-exec-1] o.h.engine.jdbc.spi...
Jovan0042
2

votes
0

answer
723

Views

Glassfish JDBC Realm with Digest Authentication

I'm working on a Java REST project and I'm currently using a JDBC Realm with Basic authentication. I'm storing SHA-256 hashes of passwords and Basic authentication works fine. To switch to Digest authentication i changed the JAAS Context of the realm from jdbcRealm to jdbcDigestRealm and in web.xml...
vision810
0

votes
0

answer
221

Views

NetBeans and Eclipse not recognizing maven dependencies

The IDEs are not recognizing the dependencies. I've already gone through several other similar questions on StackOverflow but so far nothing has worked for me. I have a maven project in which I've already declared mysql-connector-java-8.0.8-dmr and Gson-2.8.0 as dependencies, but for some reason I s...
Jorge Z
2

votes
0

answer
490

Views

Looking for DB replicator (like C-JDBC, HA-JDBC etc.)

I need to replicate my DB without adding it any columns (like the MS SQL replication does), I looked every where and every project I found was last updated 2-3 years ago (in the best case i found a project last version was from 2011). The replicator needs to support MS SQL 2005 (2008 is not required...
GustavLatte
2

votes
0

answer
112

Views

When is the database informed about a transaction from Java?

I'm interested in knowing when exactly does Java communicate to the database that a transaction has been created. When setting autocommit to false in JDBC or creating a @Transactional method in Spring, when exactly does the communication with the database occur to inform it of the transaction change...
norbitheeviljester
2

votes
0

answer
577

Views

Jdbc Ms SQL Driver 3.0 callable statement using default parameters

What is the best way to reuse a CallableStatement I want to use the same msp_updateOption in different ways and make it reusable code. Also the CallableStatement should take input as parameter type and not indexes. private static final String UPDATE_INFO = '{call msp_updateOption (?,?,?,?,?,?,?,?,?,...
djoshi
0

votes
0

answer
141

Views

Coldfusion FusionReactor Datasource error: No driver reported

I am using ColdFusion 8 and MySQL on Windows 7. I have installed Fusion Reactor and am trying to create a New Wrapped Datasource in ColdFusion, but I am getting this: error- Connection verification failed for data source: mydsn java.sql.SQLException: FusionReactor JDBC: [9] No driver reported it was...
yugalkishorbais
0

votes
0

answer
1.1k

Views

JTDS JDBC Driver on Android, Connection to Sybase

I have been trying to connect to a Sybase SQL Anywhere 11 database engine using the JTDS 1.3.1.jar driver running in an Android application. I am using Eclipse as my IDE and have set my Java Virtual Machine as 1.7 not the standard 1.6 as I believe JTDS 1.3 will only run in that version. In my code I...
MaximusDecimal