cancel
Showing results for 
Search instead for 
Did you mean: 

connect to oracle 10g

snowaja
Champ in-the-making
Champ in-the-making
I want to connect alfresco enterprise 3.2 with oracle 10g and i write this code..

import java.sql.*;

public class OracleOciConnection {

    public static void main(String args[])
{
try
{

Class.forName("orac­le.jdbc.driver.Oracl­eDriver");
Connection con = DriverManager.getConnection("jdbcSmiley Surprisedracle:thin:@localhost:1521Smiley Surprisedrcl","orcl","orcl");
Statement stmt=con.createStatement();
ResultSet rset =stmt.executeQuery("select * from table1");
while(rset.next())
{
System.out.print(rset.getString(1));
}
System.out.println("connected to oracle using oci driver");
con.close();
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
}


it okey when i compile but there have error when i execute..like..

java.lang.ClassNotFoundException: orac­le.jdbc.driver.Oracl­eDriver
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at OracleOciConnection.main(OracleOciConnection.java:10)


have any get the solution?? :?:  or other solution :idea:

should i set the class path =C:\oraclexe\app\or­acle\product\10.2.0\­server\jdbc\lib\ojdb­c14.jar

but in my pc there only C:\oracle\product\10.2.0..and haven't the server folder..why it occur like that :!:
8 REPLIES 8

mikeh
Star Contributor
Star Contributor
Please see my comment in your other post.

Mike

mrogers
Star Contributor
Star Contributor
Your posting does not seem related to Alfresco.   But yes you will need the oracle driver.

snowaja
Champ in-the-making
Champ in-the-making
I have oracle driver ojdbc14.jar and i put in C:\Alfresco\tomcat\lib
I should have others driver?

paulweb
Champ in-the-making
Champ in-the-making

snowaja
Champ in-the-making
Champ in-the-making
Its alfresco community 3.2 can connect to oracle 10g? :?

mikeh
Star Contributor
Star Contributor
Its alfresco community 3.2 can connect to oracle 10g? :?
No, Oracle is not supported by Alfresco in the Community version. PaulWeb's forge project may help (see link above).

Thanks,
Mike

snowaja
Champ in-the-making
Champ in-the-making
But this link from PaulWeb
http://forge.alfresco.com/projects/oracle
about oracle for alfresco community.. :?

mikeh
Star Contributor
Star Contributor
But this link from PaulWeb
http://forge.alfresco.com/projects/oracle
about oracle for alfresco community.. :?
Yes. The Forge is an area for community contributions. They are not supported by Alfresco.

Mike