Search Results

Search found 2 results on 1 pages for 'celia'.

Page 1/1 | 1 

  • 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

  • JQuery get id or class, not value

    - by Celia Tan
    I'm new at JQuery, what I wanted to ask is how to select an option, then another option will automatic selected that have property of first option. I've given code like this: <select name="kendaraan"> <option value="" selected>pilih kendaraan!</option> <option value="B 2011 DR" class="B2011DR">B 2011 DR</option> <option value="R 3333 OKI" class="R3333OKI">R 3333 OKI</option> <option value="k03">jazz</option> <option value="k04">innova</option> </select> <select name="driver"> <option value="" selected>pilih kendaraan!</option> <option value="s02" car="B2011DR" style="display:none">jojon</option> <option value="s01" car="B2011DR" style="display:none">mamat</option> <option value="s04" car="R3333OKI" style="display:none">tukul</option> <option value="s03" car="R3333OKI" style="display:none">mamat</option> <option value="s07" car="k03" style="display:none">bejo</option> <option value="s05" car="k03" style="display:none">mamat</option> <option value="s06" car="k03" style="display:none">tukul</option> <option value="s08" car="k04" style="display:none">budi</option> <option value="s09" car="">komeng</option> </select> $('select[name=kendaraan]').change(function() { //hide all option $('select[name=driver] option').css('display','none'); //display option only for matched driver var isCar = $('select[name=driver] option[car='+$(this).val()+']'); isCar.css('display','block'); //auto select first matched diriver $('select[name=driver]').val( $(isCar[0]).val() ) }) But the jquery code is for getting the value of "kendaraan", how to match it with the class, not the value?

    Read the article

1