我正在试图将MySQL数据库与Play-framework Java 2.5.4连接起来.
我得到了这个错误,
either dataSource or dataSourceClassName is required
这些是我在App.conf文件中使用的连接代码,
db {
db.default.driver=com.mysql.jdbc.Driver
db.default.url="jdbc:mysql://localhost:3306/playdb"
db.default.user="root"
db.default.password=
我在连接到我的MySQL数据库时遇到问题。我更新了application.conf文件以包含数据库连接信息,但得到以下错误:
CreationException: Unable to create injector, see the following errors:1) Error in custom provider, Configuration error: Configuration error[Cannot connect to database [default]]
while locating play.api.db.DBApiProvider
while loc
我使用的是MySql和Play-1.2.5,我使用application.conf中的以下行将两者连接起来,
# If you need a full JDBC configuration use the following :
db.default.driver=com.mysql.jdbc.Driver
db.default.user="root"
db.default.password="pass"
db.default.url="mysql://localhost:3306/sample"
AFAIK,如果我错了请纠正我,Play-1.2
我一直遵循Typesafe在线培训的游戏框架(我是一个完全初学者的网页设计),一切都在工作,直到部分,我们应该连接到一个数据库。
当我到达第二课的第二段视频时,这个网站:
我遇到了一个问题,这是当我尝试刷新我的浏览器时得到的错误消息:
Cannot connect to database [default]
In /Users/Arash/playconf/conf/application.conf at line 43.
40 db.default.driver=com.mysql.jdbc.Driver
41
# Here we add the database that we have
是否可以在scala和play2.5中使用mauricio/mysql-async驱动程序来连接mariadb数据库?我现在正在mariadb-java-client中使用jooq。
您是否知道任何用于scala/play的异步mariadb驱动程序,或者您是否有配置mysql-async驱动程序的示例,这些驱动程序来自mauricio for mysql或mariadb?
我正在尝试建立一个数据库连接,但当我尝试从我的数据库获取连接时,它给出了错误:
java.sql.SQLException: No suitable driver found for jdbc:mysql://play.zsinfo.nl:3306/daansander
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at me.daansander.login.database.MySql.getConnection(
我不熟悉Play框架。我使用mysql.But连接了Play。我通过创建的表单提交的数据未添加到数据库表中。我收到一个异常
[PersistenceException: java.sql.SQLException: Connection is closed!]
我使用的代码是
public static Result addBar(){
Bar bar= Form.form(Bar.class).bindFromRequest().get();
bar.save();
return redirect(routes.Application.index());
}
我正在使用RubyMine,我已经创建了我的数据库。主要的问题是我不能将数据插入到我的DB中。
代码和DB:
这是一段代码,我只是想把它连接到MySQL db
print "How much money did you earn today? $"
brut = Float(gets.chomp)
puts "This are your way to save your money:"
necesites = (brut.round(3) * 0.55)
play = (brut * 0.10)
education = (brut * 0.10)
lt
我想为多个测试环境(生产、分期、开发)定义不同的数据库连接。在阅读了文章"“之后,似乎可以在早期版本的Play中使用折叠SBT设置:
val main = play.Project(appName, appVersion, appDependencies).settings(
javaOptions in Test += "-Dconfig.file=conf/test.conf"
)
但是,如果在我的Build.scala中使用此设置,则会得到以下错误:
not found: value javaOptions
因此,我的问题是,如何为不同的测试环境定义不同的
我的java play框架(2.3)应用程序有一个奇怪的情况。如果我已经将应用程序部署到接近(地理上)我的数据库mysql,那么所有这些都可以正常工作。该请求具有与数据库的连接,运行良好且快速。但是,最后一天,我在另一个国家远程移动了数据库。应用程序进行得很好,但是,每次我创建JPA实体管理器(我认为应用程序创建到远程数据库的新连接)时,连接都非常缓慢。结果是所有的请求都非常缓慢。
根据您的经验,有一种方法可以通过应用来优化这种情况吗?
下面是我的控制器java代码:
@Transactional
public Result testperson() {
Person person=
My Play!2.0.4 web应用程序当前连接到多个RDS MySQL数据库,配置文件如下:
# Africa
db.afr.url="jdbc:mysql://<africa-server>:3306/users"
db.afr.driver=com.mysql.jdbc.Driver
db.afr.user=user1
db.afr.password=****
db.afr.logStatements=true
# Europe
db.eur.url="jdbc:mysql://<
我正在尝试通过JDBC连接到远程数据库。下面是我的连接字符串:
db=mysql://user:password@blablabla.rds.amazonaws.com/dbname
乍一看,它似乎应该可以工作,但在尝试它时,我得到了错误:
Cannot connected to the database, An attempt by a client to checkout a Connection has timed out.
我正在尝试使用Play框架(1.2.x),并在conf文件中描述了这个db连接。
有什么想法吗?
我正在尝试使用play Framework2.7.0设置一个项目,现在我尝试使用5.0.0连接到MySQL数据库。
这是我的密码。
以下是您可能需要检查的文件:
现在我尝试连接到localhost:9000,它告诉我Database 'default' needs evolution! An SQL script will be run on your database和一个run this script按钮。
这个脚本是一样的:,但是如果我单击run this script,它会告诉我
Evolution has not been applied properly. P