Search Results

Search found 418 results on 17 pages for 'db2'.

Page 3/17 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • java.sql.SQLException: No suitable driver found for jdbc:db2:

    - by Celia
    Im using hibernate to connect to my DB2 database. I got java.sql.SQLException: No suitable driver found for jdbc:db2://ldild4268.mycompany.com:55000/myDB. I have db2jcc.jar, db2jcc_javax.jar, db2jcc_license_cu.jar, db2policy.jar, db2ggjava.jar and db2umplugin.jar added into my Java Build Path. I am able to connect to my database through SQuirrel. database.properties: jdbc.driverClassName=com.ibm.db2.jcc.DB2Driver jdbc.url=jdbc:db2://ldild4268.mycompany.com:55000/myDB jdbc.username=uname jdbc.password=pwd datasource.xml: <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location"> <value>/WEB-INF/database.properties</value> </property> </bean> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="${jdbc.driverClassName}" /> <property name="url" value="${jdbc.url}" /> <property name="username" value="${jdbc.username}" /> <property name="password" value="${jdbc.password}" /> </bean> hibernate.xml: <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="dataSource" /> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.DB2Dialect</prop> <prop key="hibernate.show_sql">true</prop> </props> </property> <property name="mappingResources"> <list> <value>/myModel.hbm.xml</value> </list> </property> </bean> myModel.hbm.xml: <hibernate-mapping> <class name="com.myCompany.model.myModel" table="table1" catalog=""> <composite-id> <key-property name="key1" column="key1" length="10"/> <key-property name="key2" column="key2" length="19"/> </composite-id> <property name="name" type="string"> <column name="Name" length="50"/> </property> </class> </hibernate-mapping> myModelDaoImpl: @Repository("myModelDao") public class myModelDaoImpl extends PortfolioHibernateDaoSupport implements myModelDao{ private SessionFactory sessionFactory; public List<Date> getKey1() { return this.sessionFactory.getCurrentSession() .createQuery("select pn.key1 from com.myCompany.model.myModel pn") .list(); } public String getPs() { String query = "select pn.name from com.myCompany.model.myModel pn where pn.key1='2011-09-30' and pn.key2=1049764"; List list = getHibernateTemplate().find(query); } } also, the method getKey1 throws nullPointer exception. How can I use createquery instead of hibernateTemplate? Thanks in advance!

    Read the article

  • Db2 error : SQL0901N, SQLSTATE=58004

    - by Harv
    Hi, Can i use Atomic in the parrent procedure as well as in the procedure which the mail procedure calls. My procedure compiles perfectly, but sometimes when I execute it. I receive following error: DB2 Database Error: ERROR [58004] [IBM][DB2/NT64] SQL0901N The SQL statement failed because of a non-severe system error. Subsequent SQL statements can be processed. (Reason "Sdir len bad: 1542!=1520+14".) SQLSTATE=58004 However, surprisingly when i commented the "ATOMIC" keyword in the main procedure and ran again it ran perfectly. But when I ran it again after uncommenting it still did not give any errors and ran perfectly. So the error that I recieve is not something that I recive everytime.Could some one please let me know what could be the issue and what needs to be done to resolve this. As on goolgeing I did not find any leads on this. Thanks, Harveer

    Read the article

  • ColdFusion DSN with DB2 via ODBC

    - by bofe
    I'm attempting to connect a ColdFusion application to a DB2 ODBC DSN. Here's my error message: Connection verification failed for data source: <DSN NAME> java.sql.SQLException: [Macromedia][SequeLink JDBC Driver][ODBC Socket][IBM][CLI Driver] SQL30082N Attempt to establish connection failed with security reason "24" ("USERNAME AND/OR PASSWORD INVALID"). SQLSTATE=08001 The root cause was that: java.sql.SQLException: [Macromedia][SequeLink JDBC Driver][ODBC Socket][IBM][CLI Driver] SQL30082N Attempt to establish connection failed with security reason "24" ("USERNAME AND/OR PASSWORD INVALID"). SQLSTATE=08001 I've installed DB2 client tools on the server ColdFusion runs on. I've verified the credentials are correct.

    Read the article

  • Adjust SQL query to DB2

    - by Guy Roth
    Part of a complex query that our app is running contains the lines: ...(inner query) SELECT ... NULL as column_A, NULL as column_B, ... FROM ... This syntax of creating columns with null values is not allowed in DB2 altough it is totally OK in MSSQL and Oracle DBs. Technically I can change it to: '' as column_A, '' as column_B, But this doesn't have exactly the same meaning and can damage our calculation results. How can I create columns with null values in DB2 using other syntax??

    Read the article

  • Suggestions for a good IDE for DB2

    - by ken
    Hi all, I know, I know... it's a horrible fate but I am forced to work in an environment with DB2 on the back end. OK just kidding but the truth is I do like MSSQL's data studio a lot, and well IBM's tool is sorda crummy in my opinion... I was using the free version of Toad but I just got a new 64bit machine which is nice and all but there isn't a free version of Toad that I can find for win7 64. Does anyone have any suggestions for a good IDE to use with DB2? Being a developer I really just do a lot of looking at the DB structure and querying to see what I get back and how I want to get things back etc... Thanks for any advice!

    Read the article

  • User authorization in DB2

    - by Daziplqa
    Hi Folks, I am using win Vista, and I am trying to backup some Database under DB2. I am logged in using the Administrator user, and whenever I try to issue the backup command in the "command line processor", I get the following message: SQL1092N "ADMINISTRATOR" does not have the authority to perform the requested command. SQLSTATE=00000 BTW, I have created a username/password pair (db2admin) while installing the DB2 server. So, Will this problem will be get solved if I use the db2admin user? And how to connect to the server (local server BTW) using the db2admin user ?

    Read the article

  • How do I do a cross-platform backup/restore of a DB2 database?

    - by Pridkett
    I need to dump a couple of databases from DB2 for Mac and DB2 for Linux and then import the databases to DB2 for Windows. Unfortunately, when I try the standard backup and restore I get the following error: SQL2570N An attempt to restore on target OS "NT-32" from a backup created on source OS "?" failed due to the incompatability of operating systems or an incorrect specification of the restore command. Reason-code: "1". I've seen references to DB2 needing an IXF dump and import, but I can't find any solid information about how to do this without dozens of other steps. Any hints on how to do this in the least painful manner?

    Read the article

  • Why can't Perl's DBD::DB2 find dbivport.h during installation?

    - by Liju Mathew
    We are using a Perl utility to dump data from DB2 database. We installed DBI package and it is asking for DBD package also. We dont have root access and when we try to install DBD package we are getting the following error: ERROR BUILDING DB2.pm [lijumathew@intblade03 DBD-DB2-1.78]$ make make[1]: Entering directory '/home/lijumathew/lperl/perlsrc/DBD-DB2-1.78/Constants' gcc -c -I"/db2/db2tf1/sqllib/include" -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -m32 -march=i386 -mtune=pentium4 -DVERSION=\"1.78\" -DXS_VERSION=\"1.78\" -fPIC "-I/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE" Constants.c Running Mkbootstrap for DBD::DB2::Constants () chmod 644 Constants.bs rm -f ../blib/arch/auto/DBD/DB2/Constants/Constants.so gcc -shared -L/usr/local/lib Constants.o -o ../blib/arch/auto/DBD/DB2/Constants/Constants.so chmod 755 ../blib/arch/auto/DBD/DB2/Constants/Constants.so cp Constants.bs ../blib/arch/auto/DBD/DB2/Constants/Constants.bs chmod 644 ../blib/arch/auto/DBD/DB2/Constants/Constants.bs make[1]: Leaving directory `/home/lijumathew/lperl/perlsrc/DBD-DB2-1.78/Constants' gcc -c -I"/db2/db2tf1/sqllib/include" -I"/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBI" -I"/usr/lib/perl5/5.8.5/i386-linux-thread-multi/auto/DBI" -I"/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/DBI" -I"/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBI" -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -m32 -march=i386 -mtune=pentium4 -DVERSION=\"1.78\" -DXS_VERSION=\"1.78\" -fPIC "-I/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE" DB2.c In file included from DB2.h:22, from DB2.xs:7: dbdimp.h:10:22: dbivport.h: No such file or directory make: *** [DB2.o] Error 1 How do we fix this? Do we need root access to resolve this?

    Read the article

  • Migrating .NET/MySQL app. to DB2

    - by RPK
    I want to migrate my existing desktop Windows .NET 3.5 app. that uses MySQL as backend to DB2 Express C. I downloaded IBM Migration Toolkit to migrate the database. I have further queries: How accurate is IBM Migration Toolkit? Are there any issues? For the application, just changing the connection string will do or something else?

    Read the article

  • DB2 AS400 Java function always returns same value

    - by Nimrod Shory
    Hello, I am writing a user defined function to DB2 on AS/400 in Java and the strangest thing happen.. I am always getting the same result from the function even when i am changing it, even if i am dropping it and create it again and even when i specify NOT DETERMINISTIC.. Does any one have ever encountered a behavior like that?

    Read the article

  • DB2 Query to Hibernate Criteria

    - by Fortega
    Hi, I have a specific DB2 query, and I would like to execute this query using criteria. The query: SELECT sum(units) as volume, location_id, aged FROM ( SELECT units, location_id, CASE WHEN daysinstock < 61 THEN 'NOT_AGED' WHEN daysinstock < 91 THEN 'AGED' ELSE 'OVER_AGED' END AS AGED FROM STOCK_TABLE ) x group by location_id, aged the STOCK_TABLE contains the following fields: units, location_id, daysinstock. This table is matched by a StockDataSource object, with the same fields.

    Read the article

  • Paging enormous tables on DB2

    - by grenade
    We have a view that, without constraints, will return 90 million rows and a reporting application that needs to display paged datasets of that view. We're using nhibernate and recently noticed that its paging mechanism looks like this: select * from (select rownumber() over() as rownum, this_.COL1 as COL1_20_0_, this_.COL2 as COL2_20_0_ FROM SomeSchema.SomeView this_ WHERE this_.COL1 = 'SomeValue') as tempresult where rownum between 10 and 20 The query brings the db server to its knees. I think what's happening is that the nested query is assigning a row number to every row satisfied by the where clause before selecting the subset (rows 10 - 20). Since the nested query will return a lot of rows, the mechanism is not very efficient. I've seen lots of tips and tricks for doing this efficiently on other SQL platforms but I'm struggling to find a DB2 solution. In fact an article on IBM's own site recommends the approach that nhibernate has taken. Is there a better way?

    Read the article

  • Drop a DB2 view if it exists...

    - by grenade
    Why doesn't this work in IBM Data Studio (Eclipse): IF EXISTS (SELECT 1 FROM SYSIBM.SYSVIEWS WHERE NAME = 'MYVIEW' AND CREATOR = 'MYSCHEMA') THEN DROP VIEW MYSCHEMA.MYVIEW; END IF; I have a feeling it has to do with statement terminators (;) but I can't find a syntax that works. Another similar question at http://stackoverflow.com/questions/355687/how-to-check-a-procedure-view-table-exists-or-not-before-dropping-it-in-db2-9-1 suggests that they had to create a proc but this isn't a solution for us.

    Read the article

  • Connection to DB2 in Python

    - by Mestika
    Hi, I'm trying to create a database connection in a python script to my DB2 database. When the connection is done I've to run some different SQL statements. I googled the problem and has read the ibm_db API (http://code.google.com/p/ibm-db/wiki/APIs) but just can't seem to get it right. Here is what I got so far: import sys import getopt import timeit import multiprocessing import random import os import re import ibm_db import time from string import maketrans query_str = None conn = ibm_db.pconnect("dsn=write","usrname","secret") query_stmt = ibm_db.prepare(conn, query_str) ibm_db.execute(query_stmt, "SELECT COUNT(*) FROM accounts") result = ibm_db.fetch_assoc() print result status = ibm_db.close(conn) but I get an error. I really tried everything (or, not everything but pretty damn close) and I can't get it to work. I just need to make a automatic test python script that can test different queries with different indexes and so on and for that I need to create and remove indexes a long the way. Hope someone has a solutions or maybe knows about some example codes out there I can download and study. Thanks Mestika

    Read the article

  • db2 sql pattern matching

    - by Jitesh
    I have a table in db2 which has the following fields int xyz; string myId; string myName; Example dataset xyz | myid | myname -------------------------------- 1 | ABC.123.456 | ABC 2 | PRQS.12.34 | PQRS 3 | ZZZ.3.2.2 | blah I want to extract the rows where myName matches the character upto "." in the myId field. So from the above 3 rows, I want the firs 2 rows since myName is present in myId before "." How can I do this in the query, can I do some kind of pattern matching inside the query?

    Read the article

  • DB2: Won't allow parameterize fetch first X rows only

    - by Guy Roth
    Although in Oracle DB its is allowed to parametrize the number of rows that the query can fetch by adding to the query: select ... from ... where ... and rownum <= @MaximumRecords I can't add similar condition to acuivalent query running in DB2: It is allowed to add: select ... from ... where ... fetch first 500 rows only (where there is fixed number of rows) but not: select ... from ... where ... fetch first :1 rows only (:1 == @MaximumRecords) Is someone aware of a solution/work-around to this problem?

    Read the article

  • DB2 Child Table - Auto Delete With Parent

    - by gamerzfuse
    I have a bit of a task before me. (DB2 Database) I need to create a table that will be a child table (is that what it is called in SQL?) I need it so that it has a foreign key constraint with my other table, so when the parent table is modified (record deleted) the child table also loses that record. Once I have the table, I also need to populate it with the data from the other table (if there is an easy way to UPDATE this). If you could point me in the right direction, this would help alot, as I do not even know what syntax to look for. Thanks in advance

    Read the article

  • db2 jdbc driver does not release table locks

    - by as
    situation: We have a web service running on tomcat accessing DB2 database on AS400, we are using JTOPEN drivers for JNDI connections handled by tomcat. For handling transactions and access to database we are using Spring. For each select system takes JDBC connection from JNDI (i.e. from connection pool), does selection, and in the end it closes ResultSet, Statement and releases Connection in that order. That passes fine, shared lock on table dissappears. When we want to do update the same way as we did with select (exception on ResultSet object, we don't have one in such situation), after releasing Connection to JNDI lock on table stays. If we put maxIdle=0 for number of connections in JNDI configuration, this problem disappears, but this degrades performances, we have cca 100 users online on that service, we need few connections to be alive in pool. What do you suggest?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >