-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: ..hibernate v3 "No suitable driver" for oracle 9i
PostPosted: Fri Sep 16, 2005 10:53 am 
Beginner
Beginner

Joined: Fri Jun 10, 2005 11:51 pm
Posts: 45
...i cannot execute insert in oracle 9i R2..im using hibernate v3...here is my config file:

<hibernate-configuration>
<session-factory >

<!-- local connection properties -->
<property name="hibernate.connection.url">jdbc:oracle:thin@spykers:1521:eman</property>
<property name="hibernate.connection.driver_class">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.connection.username">scott</property>
<property name="hibernate.connection.password">tiger</property>
<property name="hibernate.show_sql">true</property>
<!-- property name="hibernate.connection.pool_size"></property -->

<!-- dialect for Oracle 9 -->
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<mapping resource="ora_spider/Student.hbm.xml"/>

</session-factory>
</hibernate-configuration>

...and here the stack trace:

---------------------------------
2282 [http-8070-Processor25] WARN org.hibernate.cfg.SettingsFactory - Could not obtain connection metadata
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:532)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:118)


Top
 Profile  
 
 Post subject: driver name
PostPosted: Fri Sep 16, 2005 10:59 am 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Quote:
<property name="hibernate.connection.driver_class">org.hibernate.dialect.Oracle9Dialect</property>


Should be oracle.jdbc.OracleDriver or oracle.jdbc.driver.OracleDriver

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 16, 2005 11:01 am 
Senior
Senior

Joined: Thu Aug 04, 2005 4:54 am
Posts: 153
Location: Birmingham, UK
Code:
<property name="hibernate.connection.driver_class">org.hibernate.dialect.Oracle9Dialect</property>


Is incorrect. The value of the property should be your Oracle JDBC driver as supplied by oracle. Something like com.oracle.jdbc you'll have to check your docs for the exact class.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 16, 2005 12:00 pm 
Beginner
Beginner

Joined: Fri Jun 10, 2005 11:51 pm
Posts: 45
.....i try to change my driver class like this:
<property name="hibernate.connection.driver_class">
oracle.jdbc.OracleDriver
</property>

but it give me an error:
-------------
828 [http-8070-Processor25] FATAL org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver class not found: oracle.jdbc.OracleDriver
java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)

...and same for oracle.jdbc.driver.OracleDriver...can anyone give me a working config file for oracle 9i R2 database using hibernate v3...tnx


Top
 Profile  
 
 Post subject: driver
PostPosted: Fri Sep 16, 2005 12:04 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Did you place the actual driver archive in ${CATALINA_HOME}/shared/lib or under WEB-INF/lib?

Also note that if your driver archive have zip extension you may need to rename it to jar. I recall that Tomcat did not pick archives with zip extension automatically.

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 18, 2005 6:46 am 
Beginner
Beginner

Joined: Fri Jun 10, 2005 11:51 pm
Posts: 45
...i put hibernate v3 to WEB-INF/lib...i can connect to MySQL putting hibernate v3 to WEB-INF/lib and the driver_class for MySQL is com.mysql.Driver...


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 18, 2005 8:04 am 
Regular
Regular

Joined: Sat Sep 03, 2005 9:07 am
Posts: 87
Location: Graz, AUSTRIA
You need the Oracle JDBC Driver in your classpath or in WEB-INF/lib

The driver is called classes12.jar and you will get it on Oracle's Homepage.

Additionally i think you need a colon right here:

<property name="hibernate.connection.url">jdbc:oracle:thin:@spykers:1521:eman</property>

Otherwise you will get an error. AFAIK this colon is a must!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 19, 2005 1:16 am 
Beginner
Beginner

Joined: Fri Jun 10, 2005 11:51 pm
Posts: 45
Semmerl
...ei thankz a lot for the help..now i can connect to Oracle Database :)

Jack


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 19, 2005 1:43 am 
Regular
Regular

Joined: Sat Sep 03, 2005 9:07 am
Posts: 87
Location: Graz, AUSTRIA
If my answer was helpful, please rate me!! Thx!


Top
 Profile  
 
 Post subject: ...help with JSP Pagination using hibernate
PostPosted: Wed Sep 21, 2005 11:35 am 
Beginner
Beginner

Joined: Fri Jun 10, 2005 11:51 pm
Posts: 45
Semmerl

...ok i will rate..can u help me with pagination on my webpage...im using a taglib but it has no effect at all...if you u have an example much better..tnx a lot...

Jack


Top
 Profile  
 
 Post subject: Re: ...help with JSP Pagination using hibernate
PostPosted: Wed Sep 21, 2005 11:36 am 
Regular
Regular

Joined: Sat Sep 03, 2005 9:07 am
Posts: 87
Location: Graz, AUSTRIA
jack182 wrote:
Semmerl

...ok i will rate..can u help me with pagination on my webpage...im using a taglib but it has no effect at all...if you u have an example much better..tnx a lot...

Jack


Are you using Java Server Faces or what Web Framework?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 21, 2005 11:42 am 
Beginner
Beginner

Joined: Fri Jun 10, 2005 11:51 pm
Posts: 45
...im using hibernate..


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 21, 2005 11:44 am 
Regular
Regular

Joined: Sat Sep 03, 2005 9:07 am
Posts: 87
Location: Graz, AUSTRIA
Yeah I know (otherwise you won't be here :))
But if I don't understand you false, you want to display the data on a webpage.
So what do you use to display data on webpages? JSF, Struts, JSP?
Or what else to you mean with pagination?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 21, 2005 11:56 am 
Beginner
Beginner

Joined: Fri Jun 10, 2005 11:51 pm
Posts: 45
...JSP only...this my code to display page but it is not effecient:

<%
int startRs = 0,endRs = 0,maxRs = 10,minRs,mod;
String ex1 = request.getParameter("start");
String ex2 = request.getParameter("end");
String act = request.getParameter("act");
if( ex1 == null & ex2 == null & act == null){
ex1="";ex2="";act="";
}

int cp = 1;
if( aitem.size() > maxRs){
for(int cout = 0 ;cout < aitem.size(); cout+=10){
%>
<a href="searchitem.jsp?start=<%= cout %>&end=<%= maxRs %>&act=yes"><%= cp %></a>
<%
cp++;
maxRs+=10;
}
}
if(act.equals("yes")){
startRs = Integer.parseInt(ex1);
endRs = Integer.parseInt(ex2);
}else{
if(maxRs > aitem.size()){
startRs = 0;
endRs = aitem.size();
}
}

%>

</label>
</td>
</tr>
</table>
<!----------------- start of the listing of Search Result of items ---------------------------------------------->

<table width="100%">
<tr class="formlabel" bgcolor="#006699">
<td width="12%">Picture</td>
<td>Item</td>
<td width="27%">Price</td>
<td width="16%">Days Left</td>
</tr>

<%
for (int x= startRs; x < endRs ; x++)
{
spider.Items t = (spider.Items) aitem.get(x);

%>

<tr>
<td><a href="itemdetails.jsp?itemid=<%= t.getId()%>&status=<%= t.getStatus() %>">
<img src="<%= t.getPicture() %>" height="35" width="50">
</a>
</td>
<td class="searchtext" width="45%"><%= t.getItemIdfc() %></td>
<td class="searchtext"><%= t.getPrice() %>&nbsp;
<a href="itemdetails.jsp?itemid=<%= t.getId()%>&status=<%= t.getStatus() %>" style="color:#0000FF">
<%if(t.getStatus().equals("sale-pending")){ %>
BuyItNow
<%}else{%>
BidNow
<%}%>
</a>
</td>
<td class="searchtext" align="center"><%= days %></td>
</tr>

<%
count++;
}
}
%>

<tr>
<td class="cell-header" colspan="4" align="right">
<label class="formlabel"><%= count %>&nbsp;Match found</label>
</td>

</tr>

</table>
----any idea how i can improve the pagination..tnx..


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 21, 2005 12:04 pm 
Beginner
Beginner

Joined: Fri Jun 10, 2005 11:51 pm
Posts: 45
Pagination such that like google search results like:

1 2 3 4 5 6 7 8 9 Next

when you clickl 2 it will display second 10 result from the database and so on..


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.