db2

configure multiple databases in zf2

匿名 (未验证) 提交于 2019-12-03 02:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How can I configure (and use) multiple databases in Zend Framework 2? Currently I have this in my global.php: return array( 'db' => array( 'driver' => 'Pdo', 'dsn' => 'mysql:dbname=my_db;host=localhost', 'driver_options' => array( PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'' ), 'username' => 'user', 'password' => '******', ), 'service_manager' => array( 'factories' => array( 'Zend\Db\Adapter\Adapter' => 'Zend\Db\Adapter\AdapterServiceFactory', ), ), ); But I do not see a way to add a second one. 回答1: If you look at the Zend\Db

Listagg alternative in db2

匿名 (未验证) 提交于 2019-12-03 02:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: My customer is using db2 database without listagg function, but I need to somehow aggregate the primary key information within one field. Right now (for Oracle) I am using this as a part of bigger query: SELECT LISTAGG ( COLUMN_NAME || ':' || CONTENT , ',' ) WITHIN GROUP ( ORDER BY COLUMN_NAME || ':' || CONTENT ) FROM TABLE WHERE ROW_IDENTIFIER_ID = I . REC_ID AND I . TABLE_RESULT_ID = T . REC_ID It there an alternative way to get result of listagg function in db2 database before DB2 as of version 9.7 Fix Pack 4 1 ? Version of my

DB2 deadlock timeout Sqlstate: 40001, reason code 68 due to update statements called from servlet using SQL

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am calling update statements one after the other from a servlet to DB2. I am getting error sqlstate 40001, reason code 68 which i found it is due to deadlock timeout. How can I resolve this issue? Can it be resolved by setting query timeout? If yes then how to use it with update statements in servlet or where to use it? 回答1: The reason code 68 already tells you this is due to a lock timeout (deadlock is reason code 2) It could be due to other users running queries at the same time that use the same data you are accessing, or your own

DB2 Unique Constraint over multiple Columns

匿名 (未验证) 提交于 2019-12-03 01:36:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there a way to create a unique constraint over multiple columns like in Mysql? UNIQUE KEY `uniqueKey` (`Field1`,`Field2`), The only thing i have found is the unique keyword directly after the field. Thanks in advance! 回答1: You should be able to add a unique constraint as: alter table t add constraint unq_field1_field2 unique(field1, field2) As with other databases, this is almost exactly equivalent to creating an index. The difference is that the constraint is named -- which can be convenient for tracking constraints and understanding

SQL1159 Initialization error with DB2 .NET Data Provider, reason code 10, tokens 0.0.0, 9.7.3

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to open a connection to DB2 in console application. It works fine. when I use the same code in a service, hosted in IIS it throws an error for DB2. Following is the error details. Am I missing some permissions in IIS ? dll :IBM.data.DB2.dll Code : DB2Connection db2Connection = new DB2Connection(connectionString); DB2Command cmdSelectUsrNameAndPassword = new DB2Command(querySelectUsernameAndPassword, db2Connection); cmdSelectUsrNameAndPassword.Connection.Open(); Throws : SQL1159 Initialization error with DB2 .NET Data Provider,

Change the session user for DB2 while using JDBC

匿名 (未验证) 提交于 2019-12-03 01:26:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have DB2 10.1 on Linux and I connect to it using Kerberos auth. Problem is that my user doesn't have permissions to do stuff so I need to impersonate another user using "SET SESSION_USER = otheruser". This works fine if I use a client like DBArtisan, but I need to do this using JDBC and it doesn't seem to work. I've tried to execute the query every time a connection is created, I can query the value of the register and it has changed, but I still get errors if I try to query the tables my user doesn't have access to but the

How to kill a process/query in DB2

匿名 (未验证) 提交于 2019-12-03 01:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I try to optimize a query. After every change, I must wait long time that the query is finished. It is really time consuming. Is there any way to see the executed queries and kill/stop them?? 回答1: In the DB2 instance command line, you can type db2 list applications show detail In this list, you should find your process, note the application id. You can use this command to kill it: db2 force application (xx) Where xx is the ID (or a comma-delimited list of IDs). Here is the DB2 for Linux/Unix/Windows v9.7 Information Center article on FORCE

Connect to DB2 database in eclipse via jdbc

匿名 (未验证) 提交于 2019-12-03 01:14:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm trying to connect to an IBM DB2 database with Eclipse (version Juno) via JDBC. I've added the drivers (external jar files) to my project and the driver is loaded correctly ... public static void main ( String [] args ) throws SQLException , ClassNotFoundException { Class . forName ( "com.ibm.db2.jcc.DB2Driver" ); System . out . println ( "Driver loaded" ); Connection dbConn = DriverManager . getConnection ( "jdbc:db2://***.**.***.*:50000/BWUEBDB" , "username" , "password" ); System . out . println ( "Connected" ); } I also know

Connecting to an IBM AS/400 DB2 Database

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm trying to connect to a client's IBM AS/400 DB2 Database from an Ubuntu Server using PHP's ODBC Driver . I have the unixODBC installed as well. My odbcinst.ini looks like this: [ IBM DB2 ODBC DRIVER ] Description = ODBC 5.1 Driver for Database Driver = /usr/ lib / x86_64 - linux - gnu / odbc / libmyodbc . so FileUsage = 1 And my odbc.ini looks like this: [ IBM DB2 ODBC DRIVER ] Driver = IBM DB2 ODBC DRIVER Description = ODBC 5.1 Driver DSN Now, my code to connect is: $server = '12.345.678.90' //IP $port = '446' //PORT $username

DB2 query Unknown column name ERRORCODE=-4460, SQLSTATE=null

匿名 (未验证) 提交于 2019-12-03 00:59:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: A co-worker has baffled us all with a query that is failing for reasons we can't divine. I can confirm that ENOTE.EN_FILTER_VALUE_L.FILTER_VALUE_DECODE does exist in the database. At least three people have stared at it trying to find misspellings. The Query: SELECT sub.ID, sub.USER_ID, sub.EN_TYPE_CODE, typ.EN_TYPE_DESC, typ.APPL_CD, filterval.FILTER_VALUE_DECODE AGENCY_TYPE, sub.EN_TYPE_CODE CONCAT ' | ' CONCAT typ.EN_TYPE_DESC ENOTE_STRING, org1.ORG_LVL1_CD, org1.ORG_LVL1_DC, org2.ORG_LVL2_CD, org2.ORG_LVL2_DC, org3.ORG_LVL3_CD, org3.ORG