Hi All,
I am trying to connect to mysql RDBMS using JDBC connector framwork. I am trying this code but it is throwing error
<b>com.sapportals.connector.connection.ConnectionFailedException: Connection Failed: Nested Exception</b>
Code that i am using to connect to the databse is
<b> try
{
Hashtable env = new Hashtable();
env.put("domain", "true");
Context initctx =new com.sapportals.portal.prt.jndisupport.InitialContext(env);
IConnectionFactory connectionFactory =(IConnectionFactory) initctx.lookup("deployedAdapters/JDBCFactory/shareable/JDBCFactory");
IConnectionSpec spec = connectionFactory.getConnectionSpec();
spec.setPropertyValue("userName","root");
spec.setPropertyValue("password","");
spec.setPropertyValue("driver","org.gjt.mm.mysql.Driver");
spec.setPropertyValue("url","jdbc:mysql://localhost/NEI");
IConnection mm_con = connectionFactory.getConnectionEx(spec);
System.err.println("HELLO WORLD SUCESS111 :"+mm_con);
}
catch (Exception e)
{
e.printStackTrace();
System.err.println("Error+ HELLO WORLD FAIL111");
}</b>
Please help ASAP. Good answers will be rewarded with points.
regards,
Parveen