
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
software.amazon.rdsdata:rds-data-api-client-library-java
Advanced tools
Java client library for AWS RDS Data API
The RDS Data API Client Library for Java provides an alternative way
to use RDS Data API. Using this library, you can map your client-side
classes to requests and responses of the Data API. This mapping support
can ease integration with some specific Java types, such as Date
, Time
,
and BigDecimal
.
The Data API Java client library is open source in GitHub. You can build the library manually from the source files, but the best practice is to consume the library using Maven:
Version 2.x
<dependency>
<groupId>software.amazon.rdsdata</groupId>
<artifactId>rds-data-api-client-library-java</artifactId>
<version>2.0.0</version>
</dependency>
Version 1.x (AWS SDK 1.x compatible)
<dependency>
<groupId>software.amazon.rdsdata</groupId>
<artifactId>rds-data-api-client-library-java</artifactId>
<version>1.0.8</version>
</dependency>
Following, you can find some common examples of using the Data API Java client library. These examples assume that you have a table accounts with two columns: accountId and name. You also have the following data transfer object (DTO).
public class Account {
int accountId;
String name;
// getters and setters omitted
}
The client library enables you to pass DTOs as input parameters. The following example shows how customer DTOs are mapped to input parameters sets.
var account1 = new Account(1, "John");
var account2 = new Account(2, "Mary");
client.forSql("INSERT INTO accounts(accountId, name) VALUES(:accountId, :name)")
.withParamSets(account1, account2)
.execute();
In some cases, it's easier to work with simple values as input parameters. You can do so with the following syntax.
client.forSql("INSERT INTO accounts(accountId, name) VALUES(:accountId, :name)")
.withParameter("accountId", 3)
.withParameter("name", "Karen")
.execute();
The following is another example that works with simple values as input parameters.
client.forSql("INSERT INTO accounts(accountId, name) VALUES(?, ?)", 4, "Peter")
.execute();
The client library provides automatic mapping to DTOs when an execution result is returned. The following examples show how the execution result is mapped to your DTOs.
List<Account> result = client.forSql("SELECT * FROM accounts")
.execute()
.mapToList(Account.class);
Account result = client.forSql("SELECT * FROM accounts WHERE account_id = 1")
.execute()
.mapToSingle(Account.class);
In many cases, the database result set contains only a single value. In order to simplify retrieving such results, the client library offers the following API:
int numberOfAccounts = client.forSql("SELECT COUNT(*) FROM accounts")
.execute()
.singleValue(Integer.class);
FAQs
Unknown package
We found that software.amazon.rdsdata:rds-data-api-client-library-java demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.