如下代码连接数据库的,怎么判断是哪个数据库,怎么用java连接数据库? 请问我们公司用VB写如下代码连接数据库
Set objConnection = CreateObject("ADODB.CONNECTION")
strConnectionString = "DSN=AR System ODBC Data Source;ARServer=globalar.jci.com;UID=ayuang;PWD=Jame12$;ARAuthentication=;ARUseUnderscores=1;SERVER=NotTheServer"
objConnection.Open strConnectionString
If (objConnection.State = 1) Then
MsgBox "数据库连接成功!"
str_Array_QueryResult = Array() '重新初始化数组为一个空数组
Set rs = CreateObject("ADODB.RECORDSET") '4 - 建立RECORDSET对象实例
Set objCommand = CreateObject("ADODB.COMMAND") '5 - 建立COMMAND对象实例
objCommand.ActiveConnection = objConnection
objCommand.CommandText = "SELECT "&chr(34)&"HPD:HelpDesk"&chr(34)&"."&chr(34)&"Case ID+"&chr(34)&" from "&chr(34)&"HPD:HelpDesk"&chr(34)&" "&chr(34)&"HPD:HelpDesk"&chr(34)&" WHERE ("&chr(34)&"HPD:HelpDesk"&chr(34)&"."&chr(34)&"Assigned To Group+"&chr(34)&" Like "&chr(39)&"%apac.gen.as%"&chr(39)&") OR ("&chr(34)&"HPD:HelpDesk"&chr(34)&"."&chr(34)&"Entry Group"&chr(34)&" Like "&chr(39)&"%apac.gen.as%"&chr(39)&") ORDER BY "&chr(34)&"HPD:HelpDesk"&chr(34)&"."&chr(34)&"Case ID+"&chr(34)&""
rs.CursorLocation = 3
rs.Open objCommand