aspose file tools*
The moose likes JDBC and the fly likes problem with connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "problem with connection" Watch "problem with connection" New topic
Author

problem with connection

Dhanashree Mankar
Ranch Hand

Joined: Aug 25, 2003
Posts: 123
String url = "jdbc racle:thin:@:myDataSource";
con = DriverManager.getConnection(url, "scott", "tiger");
Now mydatasource is host,port,databasename Can anyone tell me how to find it out?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8710
    
    6

You could speak with your database administrator. Hostname is the computer name or IP address of the computer the database resides on. The default port for an Oracle database is 1521. The database name is, well the name of the database.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Dhanashree Mankar
Ranch Hand

Joined: Aug 25, 2003
Posts: 123
I am using oracle8,jdk1.4 and windows2000 server. I got oracle thin driver in itself.I unzipped classes111.zip and addded classes111.zip file in classpath. And i made the connection as folllows
String url = "jdbc racle:thin:@host123:1521 RCL";
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
} catch(java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
}
try {
con = DriverManager.getConnection(url, "scott", "tiger");
stmt = con.createStatement();
stmt.executeUpdate(createString);
stmt.close();
con.close();
} catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
}
But when i run this i am getting error as
F:\>java CreateCoffees
ClassNotFoundException: myDriver.ClassName
SQLException: No suitable driver
Can anyone tell me what is wrong in this?
Dhanashree Mankar
Ranch Hand

Joined: Aug 25, 2003
Posts: 123
Originally posted by Dhanashree Mankar:
I am using oracle8,jdk1.4 and windows2000 server. I got oracle thin driver in itself.I unzipped classes111.zip and addded classes111.zip file in classpath.
But when i run this i am getting error as
F:\>java CreateCoffees
ClassNotFoundException: myDriver.ClassName
SQLException: No suitable driver
Can anyone tell me what is wrong in this?

-------------------------------------------------------------------------
Now i downloaded classes 12.zip and placed it in ORANT i.e oracle directoty and then unzipped it My classpath is as follows:
CLASSPATH=.;f:\j2sdk1.4.1_06\jre\lib\rt.jar;f:\ORANT\jdbc\lib\classes12.zip;f:\ORANT\jdbc\lib;
And path is:
PATH=f:\J2SDK1~1.1_0\bin;F:\ORANT\bin;F:\WINNT\system32;F:\WINNT;F:\WINNT\System
32\Wbem;F:\MSSQL7\BINN;c:\jdk1.4\bin;
But still same error is coming
plz help
Anurag Gupta
Ranch Hand

Joined: Dec 13, 2001
Posts: 40
You are having problems with setting classpath
Search for classes111.zip on your m/c and delete them.
Copy Classes_12.zip to your %JAVA_HOME%\jre\lib\ext

Alternately you could set it as:
set classpath=.;<location of the classes_12.zip>;%classpeth%
This should work.


Anurag Gupta
Anurag Gupta
Ranch Hand

Joined: Dec 13, 2001
Posts: 40
You are having problems with setting classpath
Search for classes111.zip on your m/c and delete them.
Copy Classes_12.zip to your %JAVA_HOME%\jre\lib\ext

Alternately you could set it as:
set classpath=.;<location of the classes_12.zip>;%classpath%
This should work.
Dhanashree Mankar
Ranch Hand

Joined: Aug 25, 2003
Posts: 123
Can anyone tell me what does this error mean?
F:\>java CreateCoffees
SQLException: Io exception: The Network Adapter could not establish the connection
Dhanashree Mankar
Ranch Hand

Joined: Aug 25, 2003
Posts: 123
This is my url:
String url = "jdbc racle:thin:@host123:1521 RCL";
This is my TNSNMAES.ORA entery:
CMEXAMPLE.WORLD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = host23)(PORT = 1521))
)
(CONNECT_DATA = (SID = ORCL))
(SOURCE_ROUTE = yes)
)
Dhanashree Mankar
Ranch Hand

Joined: Aug 25, 2003
Posts: 123
IT'S WORKING NOW
THANX
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with connection
 
Similar Threads
Connecting with SQL 2000
JNDI mapping in Weblogic
Is there any difference in using bean property and value in different styles
Trying to set up Connection Pooling using Glassfish
Datasource could not be located in Websphere5.0 connecting with SQL Server