Lotus教程、Java教程、Java虚拟机、Java软件综合开发社区

Lotus、Domino、Java、C#、Web、数据库综合开发教程、资料社区

Archive for the ‘Oracle’ Category

MSSQL如何查看当前数据库的连接数

Published by admin on 04月 2, 2012

1.通过系统的“性能”来查看:
开始->管理工具->性能(或者是运行里面输入 mmc)然后通过添加计数器添加 SQL 的常用统计然后在下面列出的项目里面选择用户连接就可以时时查询到数据库的连接数了。不过此方法的话需要有访问那台计算机的权限,就是要通过windows账户登陆进去才可以添加此计数器。

2.通过系统表来查询:
Read the rest of this entry »

如何查看ORACLE的版本?

Published by admin on 03月 2, 2012

COL PRODUCT FORMAT A35 COL VERSION FORMAT A15

COL STATUS FORMAT A15

SELECT * FROM PRODUCT_COMPONENT_VERSION;

常用数据库的链接方法<转过来的,收藏一下>

Published by admin on 10月 29, 2011

MySQL:
String Driver=”com.mysql.jdbc.Driver”;    //驱动程序
String URL=”jdbc:mysql://localhost:3306/db_name”;    //连接的URL,db_name为数据库名
String Username=”username”;    //用户名
String Password=”password”;    //密码
Class.forName(Driver);
Connection con=DriverManager.getConnection(URL,Username,Password);

Read the rest of this entry »

Oracle中”listener does not currently know of SID given in connect descriptor”

Published by admin on 10月 29, 2011

首先应该保证数据库的服务启动
在myeclipse的数据库视图中点 右键->new 弹出database driver的窗口,
Driver template选择oracle(thin driver),
Driver name 输入oracle
connection URL=jdbc:oracle:thin:@localhost:1521:oracle 注意localhost:1521:oracle中的oracle是数据库得sid换成你自己数据库的sid就可以
username:登陆数据库具有system权限的用户名
password:登陆数据库具有system权限的密码
点击add jar 选择ojdbc14.jar的存放位置,没有得可以到百度下一个叫ojdbc14.jar的文件。
点击test driver 到此成功配置。

Read the rest of this entry »

Listener refused the connection with the following error:ORA-12519

Published by admin on 10月 29, 2011

web应用连接oracle数据库时,经常在查询数据时发生

Listener refused the connection with the following error: ORA-12519, TNS:no appropriate service handler found The Connection descriptor used by the client was: 127.0.0.1:1521:ORCL

这种错误,网上查了很多,都说是ip地址改变之后的问题,要把tnsnames.ora中的实例配置中改为计算机名,我试过之后问题还是不能解决,今天终于找到问题所在了,是数据库连接数量的问题,12519错误为监听不能提供服务,通常为数据库进程达到上限导致。
Read the rest of this entry »

SP2-1503: 无法初始化 Oracle 调用界面|SP2-0152: ORACLE 不能正常工作

Published by admin on 08月 27, 2011

系统环境:WINDOW7+Oracle10g+PL/SQL 8.0

问题描述:

1、安装Oracle并启动服务后,使用PLSQL连接数据库不成功,界面为空白。

2、使用sqlplus连接数据库。

>sqlplus /nolog

提示:SP2-1503: 无法初始化 Oracle 调用界面

SP2-0152: ORACLE 不能正常工作

Read the rest of this entry »

lotus连接访问MS SQL SERVER数据库

Published by admin on 06月 15, 2011

方式有很多如:

1、使用DECS、LEI

2、自动写接口:ODBC(LOTUSSCRIPT)、JDBC(JAVA)、ADO(LOTUSSCRIPT)等方式

用ADO连接SQL是比较好的,不用象ODBC一样建DSN,速度快,稳定。Sub Initialize
On Error Goto err_code
starttime=Now
Dim session As New Notessession
Dim db As Notesdatabase
Dim doc As notesdocument
Dim view As NotesView
Dim c As NotesViewEntryCollection
Read the rest of this entry »

关于hibernate 中如果有top查询

Published by admin on 06月 14, 2011

在ssh的hibernate中写上这个方法

  public List findTop(){
log.debug(”finding all Bulletin instances”);
try {
String queryString = “select top 10 from Bulletin order by Bulletin_Time desc”;

return getHibernateTemplate().find(queryString);
} catch (RuntimeException re) {
log.error(”find all failed”, re);
throw re;
}
}
Read the rest of this entry »

PowerDesign跟数据库相连,导入,导出

Published by admin on 06月 5, 2011

PowerDesigner可以和数据库连接,根据在PowerDesigner创建的数据模型创建表、触发器、存储过程到数据库中。也可以将已有的数据库导出到PowerDesigner中为数据模型。今天做了一下测试,发现确实很简单,现在操作步骤与大家分享:

0、准备工作

先在SQL Server中创建一数据库,以供测试用。

Create database test

1、 根据在PowerDesigner创建的数据模型创建表、触发器、存储过程到数据库中

1)打开PowerDesigner ,建立一个物理数据模型

Read the rest of this entry »

Hibernate之deleted object would be re-saved by cascade异常org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations)

Published by admin on 04月 18, 2011

在Hibernate中,删除存在关联关系的一个对象时,会出现 org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations)这个异常

至于具体的持久类和配置文件就不发了,网上也有很多的解决办法。

比如:解决方案如下:
方法1 删除Set方的cascade
方法2 解决关联关系后,再删除 :

Read the rest of this entry »