java.lang.Object
java.lang.Throwable
java.lang.Error
java.lang.LinkageError
java.lang.ClassFormatError
java.lang.UnsupportedClassVersionError
- All Implemented Interfaces:
- Serializable
- See Also:
- Top Examples, Source Code
public UnsupportedClassVersionError()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[907]Unable to connect to the database
By adityanagaprasad { at } rediffmail { dot } com on 2004/09/20 03:00:10 Rate
Hi
I have a small application that is to be deployed in weblogic8.1 server.
For this i created a connection pool 'ibs' and a datasource 'ibs'. I am using oracle as by back end.The datasource look up is 'jdbc/ibs'. But i am unable to connect to the database.Below is my code.
can anyone help me out ??
Your help will be of great help to me.
import java.util.*;
import javax.naming.*;
import java.sql.*;
import javax.sql.*;
public class TestClass {
public TestClass ( )
{
}
public static void main ( String [ ] args ) {
System.out.println ( "Entered the main" ) ;
String dsLookUp = "jdbc/ibs"; // Enter value for Database Schema lookup
DataSource ds = null;
String initCtxt = "weblogic.jndi.WLInitialContextFactory";
Connection conn = null;
Context ctx = null;
try {
System.out.println ( "IBSDbUtil : getDataSource : before getInitContext ( ) " ) ;
Properties prop=new Properties ( ) ;
System.out.println ( "IBSDBUtil : getInitialContext : before prop.put"+initCtxt ) ;
prop.put ( javax.naming.Context.INITIAL_CONTEXT_FACTORY, initCtxt ) ;
System.out.println ( "IBSDBUtil : getInitialContext : before prop.put"+initCtxt ) ;
ctx = new InitialContext ( prop ) ;
System.out.println ( "IBSDbUtil : getDataSource : after getInitContext ( ) " ) ;
ds = ( DataSource ) ctx.lookup ( dsLookUp ) ;
}
catch ( Exception ex ) {
ex.printStackTrace ( ) ;
// Handle exception
}
try
{
System.out.println ( " IBSDbUtil : getDbConnection :Before getConnection: ds.toString ( ) "+ds.toString ( ) ) ;
conn = ds.getConnection ( "ebank","ebank" ) ;
}
catch ( SQLException ex )
{
System.out.println ( "IBSDbUtil : getDbConnection: SQLException: "+ex ) ;
}
catch ( Exception ex )
{
System.out.println ( "IBSDbUtil : getDbConnection: Exception: "+ex ) ;
}
System.out.println ( " IBSDbUtil : getDbConnection :return" ) ;
}
}
public UnsupportedClassVersionError(String s)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples