I am testing my application which uses dynamoDB. I have started an instance locally using docker and I’m able to create / add items in the instance. Now, inside my Java application, I am trying to connect to my local and when I’m sending an API call that interacts with my local Dynamo, it throws a…
Tag: database-connection
Difference between connecting to a database using DriverManager and SpringBoot(Hibernate)
There are 2 ways to connect to a database when developing Java apps. Using DriverManager Connection conn = DriverManager.getConnection(url, name, password); // execute the query. Using application property file in SpringBoot spring.jpa.hibernate.ddl-auto=none spring.datasource.url=jdbc:mysql://localhost:5432/…
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…
Checking connection to MySQL (Java)
I’m working on creating my little-utility for MySQL, and I need some help. How I can check connection to MySQL (by login and password), like it was realised in phpMyAdmin, without pointing some database at first. Because most of solutions for work with databases need exactly that pointing. Thanks in adv…
java.sql.SQLException: ORA-01005: null password given; logon denied
I’m getting the follwing exception while trying to connect to a database: here the method used to get the connection: But even when the params (url, password..) are hardcoded, I still get the exception. Could you tell me how to fix this problem ? thanks Answer it appears the problem is linked to the …
What is the difference between OCI and THIN driver connection with data source connection between java and oracle XE?
I’m writing the below codes for connection between the java and Oracle 10g XE using 3 way(OCI, THIN and data source), the code is running successfully but don’t know difference between the THIN and OCI with data source connection. 1- 2- 3- Answer Oracle provides four types of drivers for their dat…
Why do I need Transaction in Hibernate for read-only operations?
Why do I need Transaction in Hibernate for read-only operations? Does the following transaction put a lock in the DB? Example code to fetch from DB: Can I use session.close() instead of tx.commit()? Answer Transactions for reading might look indeed strange and often people don’t mark methods for transac…