Gateways, Oracle Lite, Oracle DB Mob. Server, TimesTen (MOSC)

MOSC Banner

DMS: Get connection via Java API without use file mobileserverid.dat ?

Hi all,

I am looking how to create a connection code to Mobile server without use file mobileserverid.dat  ?

E,g i have this code into my java API application

==============

private static Connection getConnection(String user ,String password)
{

Connection conn =null;

try
{

DriverManager.registerDriver((Driver)(Class.forName("oracle.jdbc.driver.OracleDriver").newInstance()));

}
catch(Exception e)
{
e.printStackTrace();
}
try
{

conn=null;
String jdbc_url = "jdbc:oracle:thin:@ + hostName + :" + DBPort + ":" + SID;
conn = DriverManager.getConnection(jdbc_url,user,password);

}
catch(Exception e)
{
e.printStackTrace();
}

return conn;
}
}

;

======================

It works fine from Mobile Server or SDK system , but from a clean PC you have this error :

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center