Skip to content
Advertisement

Tag: jdbc

Configure a `DataSource` to connect to a managed Postgres server on Digital Ocean with SSL/TLS encryption

I am trying the managed database service on DigitalOcean.com, having created a Postgres instance. Digital Ocean defaults to requiring remote connections be made with SSL (actually TLS) encryption. How does one configure a JDBC DataSource implementation for providing connections to such a database server? This Question is similar to Produce a DataSource object for Postgres JDBC, programmatically but adds the

Getting the SQL Server Connection Exception

I am getting below connection exception, when trying to connect to SQL Server using JDBC. Can someone please help, with this issue? I am using sqljdbc4.jar file to connect to SQL Server Code is as below This is the exception. Nov 14, 2020 8:33:01 PM com.microsoft.sqlserver.jdbc.TDSChannel enableSSL INFO: java.security path: /usr/java/jdk1.8.0_261-amd64/jre/lib/security Security providers: [SUN version 1.8, SunRsaSign version 1.8, SunEC

How close possibility to add new data in H2?

I have a problem. After adding some data to database, I need to set read-only mode for whole DB. What is the easiest way to do that using h2 embedded DB with driver manager (jdbc)? Answer You can open the whole database in read-only mode by appending ;ACCESS_MODE_DATA=r to the JDBC URL (“jdbc:h2:” + “./” + dbName + “;ACCESS_MODE_DATA=r” in

WAS gets hung WSVR0605W due to jdbc preparedstatement execute WCS

I’m trying to execute three different prepared statements inside a function which basically does an insert in three different tables. File registration.java createConnection method – I’m using ojdbc6.jar When I call the regPoints function from a webpage in my local RAD or local environment its working perfectly fine. But the same doesn’t work when it’s running on a test environment.

setReadOnly not working on PostgreSQL Connection

I have a problem setting a read-only connection with a PostgreSQL database using JDBC. I’m creating an application which loads queries to execute from a file, and I want to execute only SELECT (read-only) queries. Setting permissions on users who will run the application is not an option, so setting permissions at code level through the Connection.setReadOnly(boolean) method was the

SAP DBTech JDBC: Cannot connect to jdbc:sap://… on SCP

I’m running a Java application in the SAP Cloud Platform that connects to a shared HANA database using JDBC. Out of a sudden (no code changes, no deployments, no config changes…) the application can no longer connect to the database. The logs/stacktrace says: Failed to get connection from datasource com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: Cannot connect to jdbc:sap://xxxx.od.sap.biz:30015/ [Cannot connect to

JDBC4 syntax error, but MySQL accepts the query

I’ve tried running the following query with JDBC4, which leads to a syntax error: Strangely enough, when I run the query via mysql (on the same database server), the query is accepted and run. The error message is even more confusing, as there is no closing ) on line 1. The server is running MySQL 5.1. Answer JDBC accepts parameters

Java PreparedStatement preserve table name casing

I have this Java snippet, running inside a WildFly server backed by MariaDB: which gives me the following exception: So, apparentally, it decided to uppercase the table name, which I don’t want. How can I turn it off? Answer That is not possible, SQL dialects are – usually – case insensitive by default, but store the table name in uppercase

Advertisement