toolkits-akka-commons

Library of commonly used akka tools

License

License

Categories

Categories

Akka Container Microservices Reactive libraries
GroupId

GroupId

dev.xethh.libs.toolkits.akka
ArtifactId

ArtifactId

commons_2.13
Last Version

Last Version

1.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

toolkits-akka-commons
Library of commonly used akka tools
Project URL

Project URL

https://github.com/O7UNp/libs-toolkits-tooakka-commons
Source Code Management

Source Code Management

https://github.com/xh-dev/libs-toolkits-akka-commons

Download commons_2.13

How to add to project

<!-- https://jarcasting.com/artifacts/dev.xethh.libs.toolkits.akka/commons_2.13/ -->
<dependency>
    <groupId>dev.xethh.libs.toolkits.akka</groupId>
    <artifactId>commons_2.13</artifactId>
    <version>1.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/dev.xethh.libs.toolkits.akka/commons_2.13/
implementation 'dev.xethh.libs.toolkits.akka:commons_2.13:1.0.2'
// https://jarcasting.com/artifacts/dev.xethh.libs.toolkits.akka/commons_2.13/
implementation ("dev.xethh.libs.toolkits.akka:commons_2.13:1.0.2")
'dev.xethh.libs.toolkits.akka:commons_2.13:jar:1.0.2'
<dependency org="dev.xethh.libs.toolkits.akka" name="commons_2.13" rev="1.0.2">
  <artifact name="commons_2.13" type="jar" />
</dependency>
@Grapes(
@Grab(group='dev.xethh.libs.toolkits.akka', module='commons_2.13', version='1.0.2')
)
libraryDependencies += "dev.xethh.libs.toolkits.akka" % "commons_2.13" % "1.0.2"
[dev.xethh.libs.toolkits.akka/commons_2.13 "1.0.2"]

Dependencies

compile (5)

Group / Artifact Type Version
me.xethh.utils : DateUtils jar 6.0.0.RC9
dev.xethh.libs.toolkits : commons jar 1.0.1
org.slf4j : slf4j-api jar 1.7.30
com.typesafe.akka : akka-actor_2.13 jar 2.6.10
org.scala-lang : scala-library jar 2.13.3

test (1)

Group / Artifact Type Version
junit : junit jar 4.13.1

Project Modules

There are no modules declared in this project.

Maven

        <dependency>
            <groupId>dev.xethh.libs.toolkits.akka</groupId>
            <artifactId>commons</artifactId>
            <version>1.0.1</version>
        </dependency>

JDBC Extension

JDBCConnection extension

import dev.xethh.libs.toolkits.akka.commons.jdbcExtension.ext._
import java.sql.Connection
val conn:Connection 

// call method return a value from sub scope of connection with closing connection after result occurred
val countOfRecord = conn.call{_=>    
          conn.prepareNoParam("select count(*) from Table") // Prepare statement with no parameter
              .executeQuery() // execute query to obtain result set
              .nextAs{rs=>    // nextAs pass result set in lambda as rs and get the result
                rs.getLong(1)
              }
      }

// run method run jdbc operation from sub scope with closing connection before leave
conn.run{ _=>
  // prepare method will crate prepared statement and provide sub scope for fill in parameter
  conn.prepare("Update Table set value=? where field=?"){stmt=>
    stmt.setString(1, "value")
    stmt.setString(2, "field")
  }.execute()
}

Versions

Version
1.0.2
1.0.1
1.0.0