Skip to content

Instantly share code, notes, and snippets.

View gamlerhart's full-sized avatar

Roman Stoffel gamlerhart

View GitHub Profile
turbo login <my-user>
turbo run ssms2014
from clean
startup file EXIT 0
@gamlerhart
gamlerhart / combine-versions.bat
Last active August 29, 2015 14:10
Containerized Scala builds with SBT
# JDK 8 with the latest SBT
spoon jdk:8.20,sbt
# JDK 7 with SBT 0.13.5
spoon jdk:8.20,sbt:0.13.5
# JDK 6 with SBT 0.12.4
spoon jdk:8.20,sbt:0.12.4
# Need more memory? Use the 64Bit version of the JDK
@gamlerhart
gamlerhart / AddDebugFlag.scala
Last active December 14, 2015 08:28
Scala ADBCJ Getting Started
val database: DatabaseAccess = Database("adbcj:pooled:mysql://localhost/adbcj-demo",
"adbcj",
"adbcj-pwd",
StandardProperties.CAPTURE_CALL_STACK->"true") // Enable debug stack traces
@gamlerhart
gamlerhart / ConfigProperties.java
Last active December 10, 2015 00:09
ADBCJ updates
Map<String,String> poolConfig = new HashMap<String, String>();
poolConfig.put("pool.maxConnections","50");
poolConfig.put("pool.maxWaitForConnection","500");
ConnectionManager pooledMysql
= ConnectionManagerProvider.createConnectionManager(
"adbcj:pooled:mysql://localhost/adbcjtck",
"root",
"",
poolConfig);
@gamlerhart
gamlerhart / enhancer-step.xml
Created October 1, 2012 11:54
VJPA and Maven
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<dependencies>
<!-- Using the Versant JPA enhancer as a dependency here -->
<dependency>
<groupId>com.versant</groupId>
<artifactId>versant-jpa-enhancer</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
@gamlerhart
gamlerhart / MyListTest.java
Created September 1, 2012 12:25
Google Guava Testlib
private Test myListTestSuite() {
return ListTestSuiteBuilder.using(
// This class is responsible for creating the collection
// And providing data, which can be put into the collection
// Here we use a abstract generator which will create strings
// which will be put into the collection
new TestStringListGenerator(){
@Override
protected List<String> create(String[] elements) {
// Fill here your collection with the given elements
@gamlerhart
gamlerhart / install.bat
Created August 15, 2012 16:27
Versant-Maven
set LIB_PATH=%VERSANT_ROOT%/lib
mvn install:install-file -DgroupId=com.versant -DartifactId=versant-jpa-enhancer -Dpackaging=jar -Dversion=8.0-SNAPSHOT -Dfile=%LIB_PATH%/vodjpa.jar -DpomFile=./pom-versant-jpa-enhancer.xml
mvn install:install-file -DgroupId=com.versant -DartifactId=versant-jpa -Dpackaging=jar -Dversion=8.0-SNAPSHOT -Dfile=%LIB_PATH%/vodjpa.jar -DpomFile=./pom-versant-jpa.xml
@gamlerhart
gamlerhart / orm.xml
Created June 12, 2012 19:14
VJPA with XML
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
version="2.0">
<entity class="info.gamlor.jpa.NamedItem" access="FIELD">
<attributes>
<id name="id"/>
</attributes>
</entity>
// grab the extension
val dbSupport = Database(actorSystem)
val result = for{
// open the connection asynchronously
connection <- dbSupport.connect()
// Execute a query quest
newestEmployee <- connection.executeQuery(
"SELECT first_name,last_name,hire_date FROM employees " +
"ORDER BY hire_date DESC " +