Caused by: java.sql.SQLException: Io 异常: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=169869568)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:404)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
... 19 more
Exception in thread "main" java.lang.NullPointerException
at test.GetAllHouseInfo.main(GetAllHouseInfo.java:12)
------解决方案--------------------------------------------------------
GetAllHouseInfo.java第12行空指针异常。检查下。
------解决方案--------------------------------------------------------
检查你连接:数据库名,用户名,密码,是否正确
机器"数据库的服务是否启动了"?
------解决方案--------------------------------------------------------
明显的 数据库链接肯定有问题,能贴出来看看?
------解决方案--------------------------------------------------------
代码都没有看什么啊?
------解决方案--------------------------------------------------------
连接文件中没有设置数据库方言。。
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
这个需要设置。。这是mysql的设置