- 浏览: 1076589 次
- 性别:
- 来自: 杭州
文章分类
- 全部博客 (399)
- C++ (39)
- Java (74)
- Java界面开发学习笔记 (4)
- Java用户的c++之旅 (0)
- 自言自语 (12)
- DSP (1)
- MCU (0)
- CG (0)
- Jabber (0)
- Gloox (0)
- Linux (11)
- Windows (19)
- Networks (4)
- Jobs (0)
- PHP (1)
- JSP (2)
- 生活 (35)
- C (2)
- Qt4 (2)
- C# (50)
- WPF (5)
- ASP (2)
- FLEX (47)
- SQL (20)
- JavaScript (12)
- SharePoint (6)
- GWT (1)
- Dojo (9)
- HTML (11)
- Others (7)
- 如何安装配置系列 (7)
- UML (2)
- Android (3)
- alibaba (1)
最新评论
-
zxjlwt:
学习了http://surenpi.com
Firefox插件开发: Hello World! -
ylldzz:
楼主知道MVEL怎么调试么
MVEL简介及快速使用 -
blueman2012:
您好,可否提供源码下载,我把您的代码贴过来后,好多报错的,谢谢 ...
Log4J日志解析 -
svygh123:
你的游标都没有关闭呢!
MYSQL游标嵌套循环示例 -
dizh:
写的很好啊
MVEL简介及快速使用
Ok, You read this post I assume you face the same problem I faced. Quick Solution : If this is your MySQL Connection URL : “jdbc:mysql://localhost/DN_NAME” Change it to “jdbc:mysql://127.0.0.1/DB_NAME” Understanding the solution : Recently, I am developing a grails application. I was using the default in memory HSQLDB, as it is wonderful for changing the database design frequently. But, as I felt stability in the project I wanned to move the project to the next level where data get persisted. Hence, I tried to move to MySQL Database by modifying the DataSource.groovy File. dataSource { // MySQL Database configurations And result was a very long exception Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘transactionManager’: Cannot resolve reference to bean ‘sessionFactory’ while setting bean property ‘sessionFactory’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sessionFactory’: Cannot resolve reference to bean ‘hibernateProperties’ while setting bean property ‘hibernateProperties’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘hibernateProperties’: Cannot resolve reference to bean ‘dialectDetector’ while setting bean property ‘properties’ with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘dialectDetector’: Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Could not get Connection for extracting meta data; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure So, I tried to Google on PoolableConnectionFactor .. But Results was either Change /etc/hosts.allow and check /etc/hosts or Some changes in /etc/my.cnf and grant access to the database user And they all failed. So I created a new Java Project in NetBeans IDE, added the JDBC Driver Jar file, and wrote the following code: String dbUrl = “jdbc:mysql://localhost:3306/DB_NAME”; So, the following single exception appeared : Dec 5, 2009 9:02:41 AM testmysql.Main main So, I Googled again and I found this post Which is long, and here is the main point of it : So, It seams the PC is defaulting to IPv6 not IPv4 and the solution is as I said above Change the MySQL Connection URL from localhost to 127.0.0.1 (or whatever your localhost IP Address is ) NOTE: you can find you localhost IP Address in /etc/hosts NOTE: If you use openSuse Linux ( Like I Do ) and you want to disable IPv6, you can do so using Yast-> Network Manager Wish you best of luck. ——————————————————————————————— New Updates : I had another PoolableConnectionFactory exception. This time because I had reinstalled my Linux system, so my databases were gone. I got the following exception Cannot create PoolableConnectionFactory (Unknown database ‘DB_NAME‘): Because, there was no Database scheme in the mysql database engine. So, to solve this: Now, you can restart your grails application and this exception will not show up again. Wish you best of luck.
pooled = true
// driverClassName = “org.hsqldb.jdbcDriver”
// username = “sa”
// password = “”
driverClassName = “com.mysql.jdbc.Driver”
username = “root”
password = “123456″
}
Class.forName ( “com.mysql.jdbc.Driver” );
Connection connection = DriverManager.getConnection ( dbUrl , “root” , “123456″ );
SEVERE: null
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database ‘DB_NAME‘
发表评论
-
Interesting interview question…
2011-06-23 19:10 1448Today I was asked this questi ... -
简单易用的Web框架:SummerCool介绍
2011-05-10 19:01 4743SummerCool是国内某大型电子商务平台的架构师自 ... -
[转]Eclipse插件:Java AST View
2011-05-06 16:03 4614转载:http://www.blogjava.net/life ... -
Eclipse之Debug技巧
2011-05-02 15:30 1559你认为你的eclipse debug技能都学会了吗?能够熟 ... -
AccessController.doPrivileged 小记
2011-04-29 20:29 2075原文:http://blog.csdn.net/tea ... -
推荐一个下载源码的网站
2011-04-29 20:26 1245http://olex.openlogic.com/ 这个网 ... -
Java解析xml禁止校验dtd
2011-04-27 21:34 8389今天在做log4j.xml解析的时候,指定了如下的dtd声明: ... -
区分getName、getCanonicalName与getSimpleName
2011-04-27 18:34 5764举例,现有一个类如下: package com.sha ... -
Log4J日志解析
2011-04-25 16:12 7053在有些场景下,需要解析Log4J的日志,以为己用。比如,根据 ... -
分享个不错的网站:看JSON字符串的利器
2011-04-20 20:09 1304分享个不错的网站:看JSON字符串的利器or胸器 http: ... -
Regex:密码验证
2011-04-13 18:45 20044.当且仅当含数字和字母的密码验证 如果密码当且仅当 ... -
JDBC操作数据库时切记关闭资源
2011-04-08 18:14 1865Error: No ManagedConnectio ... -
JDBC:如何将resultset的信息自动封装到pojo里面
2011-04-08 10:32 4307不多说了 直接上代码 Java代码 p ... -
Maven自动升级版本号并打包上传的脚本
2011-04-02 09:52 7517同事写的自动升级版本并打包上传的脚本: echo of ... -
在ibatis中使用$value$引入变量会引入SQLInjection漏洞
2011-04-01 16:26 2312(1)sql语法中的_关键字_.如果sql语句中出现存在用户输 ... -
EqualsBuilder和HashCodeBuilder
2011-03-31 19:30 2221自动化hashCode()和equals() 问题产生:当需 ... -
Eclipse中的Stack Trace Console的使用
2011-03-15 14:47 3023很多的Java程序员(特别是开发Web程序的时候),通常在 ... -
System.out.format的使用
2011-01-21 12:34 4794JDK5.0允许象C语言那样直接用printf()方法来格式化 ... -
jhat的简单使用
2011-01-18 19:41 2890leak一般会发生在容器类保存对象引用而不删除的时候,替代方法 ... -
关于变更eclipse中maven插件的repository路径
2011-01-10 10:02 17031.打开eclipse 2.window-->ref ...
相关推荐
**Grails插件:Calendar** Grails是一款基于Groovy语言的开源Web应用框架,它简化了Java开发,提供了丰富的功能和灵活的架构。在Grails社区中,开发人员经常创建插件来扩展框架的功能,满足特定的需求。"Calendar...
《Grails 2 的终极指南》是一本深入探讨Grails框架精髓的专业书籍,该书以英文撰写,旨在为读者提供全面、深入的Grails框架学习资料。Grails框架基于Groovy语言,是一种高度动态、敏捷的Java应用开发框架,它简化了...
grails1.0开发框架4 类似于ruby on rails的框架。
标题中的“grails3 CAS链接接数据库”表明我们要讨论的是如何在Grails 3框架下集成CAS(Central Authentication Service)并实现与数据库的连接。Grails是一个基于Groovy语言的开源Web应用框架,而CAS是一种广泛使用...
testwebsocket-grails3 这是一个基本的 Grails 3 应用程序,它尝试通过 Spring Boot 使用 websockets。成功:我们使用新的 WebSocketConfigurer 以及传统的默认 Java Websockets 工作的 websockets: 有两个索引页,...
《Grails与Spring Boot的深度集成解析》 在现代Java开发领域,Grails和Spring Boot都是非常流行的框架。Grails作为Groovy语言构建的Web开发框架,以其强大的生产力和灵活的特性受到开发者的喜爱,而Spring Boot则...
Grails和Groovy是两个密切相关的技术,它们在IT领域,尤其是Web开发中扮演着重要角色。Grails是一个基于Groovy语言的开源Web应用框架,它简化了开发过程,提供了丰富的功能,而Groovy则是一种面向Java平台的动态编程...
在本文中,我们将详细探讨如何在Eclipse集成开发环境中搭建Grails开发环境。Grails是一个基于Groovy语言的开源Web应用程序框架,它简化了Java平台上的Web应用开发流程。通过Eclipse,我们可以获得强大的开发工具支持...
D:\Temp\grails_apps>grails create-app demo Welcome to Grails 0.4.2 - http://grails.org/ Licensed under Apache Standard License 2.0 Grails home is set to: D:\D\MY_DEV\grails Base Directory: D:\...
Java web development is notoriously tedious, but help is on the way: Grails. Using the principle of convention-over-configuration and the dynamic Groovy programming language, Grails takes the pain out...
这个例子实现了用grails 连接mysql 数据库,并且把内容显示出来,可以增删除改,下载这个例子后大家要把jdk tomcat grails环境搭好,然后用grails run-app来执行,也可以用其它的开发工具,本人用的是netbeans
Grails Pjax插件Pjax在Grails中。 Pjax类似于(turbolinks)[ ,在'A'标签,按钮和表单上工作。 参见_pjaxHeader grails templtate文件中的演示代码。 ## Pjax是什么? Pjax是一个jQuery插件,它使用ajax和pushState...
建置状态 ...ils子 是用于使用编程语言构建Web应用程序的... grails create-app sampleapp cd sampleapp grails run-app 要构建Grails,请克隆此GitHub存储库并执行安装Gradle目标: git clone https://github.com/grails
Grails-MyBatis 用于 Grails 框架的 MyBatis 插件 基于原始 Grails-iBatis 插件:Brian Sanders ( ) Grails 插件主页: : 修改: 命名约定的一些变化 添加了对多个数据源的完全支持 Grails 2.0 插件重构 最小 ...
**Grails-Flyway 插件详解:数据库迁移利器** 在现代软件开发中,随着项目的迭代,数据库结构也需要随之变化,以适应业务需求。数据库迁移工具应运而生,它们帮助开发者管理数据库版本,确保在多环境下的数据一致性...
在IT行业中,Grails是一个基于Groovy语言的开源Web应用框架,它简化了Java平台上的开发工作。Grails 3是其一个重要的版本更新,带来了许多改进和新特性。本篇将详细介绍如何在Grails 3中配置单独的数据库properties...
### Grails 2: A Quick-Start Guide #### 书籍概览 《Grails 2:快速入门指南》是一本专为希望快速掌握Grails框架的开发者编写的实用指南。本书由Dave Klein与Ben Klein共同编写,通过一个逐步迭代的小项目来介绍...