我的build.gradle目前是:
project(':rss-middletier') {
apply plugin: 'java'
dependencies {
compile project(':rss-core')
compile 'asm:asm-all:3.2'
compile 'com.sun.jersey:jersey-server:1.9.1'
compile group: 'org.javalite', name: 'activejdbc', version: '1.4.9'
}
jar {
from(configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }) {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
manifest { attributes 'Main-Class':
'com.netflix.recipes.rss.server.MiddleTierServer' }
}
}
Run Code Online (Sandbox Code Playgroud)
但是,我不想直接将这些编译的类打包到jar中,而是首先通过运行以下任务来检测它们:
task instrument(dependsOn: 'build', type: JavaExec) {
main = 'org.javalite.instrumentation.Main'
classpath = buildscript.configurations.classpath
classpath += project(':rss-middletier').sourceSets.main.runtimeClasspath
jvmArgs '-DoutputDirectory=' + project(':rss-middletier').sourceSets
.main.output.classesDir.getPath()
}
Run Code Online (Sandbox Code Playgroud)
只有在我对这些类进行了检测之后,我才会将它们打包成一个JAR文件.有没有办法让我可以在包装之前做这个仪器?
非常感谢!!!
我有一个基于ActiveJDBC的应用程序,用于数据库交互.我现在正处于多线程的过程中,但我遇到了几个问题.
每当我尝试从数据库中获取对象时,我都会遇到以下异常: Cannot open a new connection because existing connection is still on current thread, dbName: default, connection instance: com.mchange.v2.c3p0.impl.NewProxyConnection@75412c2f. This might indicate a logical error in your application.
注意它说com.mchange.v2.c3p0.impl.NewProxyConnection.这是因为我已经尝试使用DataSources,但也没有.有人能指出我的轨道或建议一个替代(线程安全)Active JDBC?
谢谢.
官方网站称该库支持SQLite 3.Android拥有SQLite.是否可以在Android Studio项目中使用JavaLite的ActiveJDBC?
网站说,这样做的结果如下:
Base.open("com.mysql.jdbc.Driver", "jdbc:mysql://localhost/test", "the_user", "the_password");
Employee.findAll().dump();
Base.close();
Run Code Online (Sandbox Code Playgroud)
在Android的情况下,如何将库连接到SQLite数据库?
今天我发现了一些有趣的图书馆--ActiveJDBC.它提供了类似RoR的ActiveRecord接口,我正在考虑更换Hibernate,但是有一个问题 - ActiveJDBC可以处理真正大的查询和结果吗?在任何应用程序中使用它而不是Hibernate是否聪明?
activejdbc ×4
java ×4
activerecord ×1
android ×1
build.gradle ×1
gradle ×1
hibernate ×1
jar ×1
javalite ×1
mysql ×1
sqlite ×1