Hi all,
I'm new to android application. I'm trying to access oracle database from
my application. Below is my code for my database connectivity. I'm unable
to connect. i put ojdbc14.jar in class path also. but getting class not
found error in log cat. I'm using android 1.6. can anybody help to fix this
issue???
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection connection = DriverManager
.getConnection("jdbc:oracle:thin:10.0.2.2:1521:XE",
"training", "training");
if (connection != null) {
System.out
.println("connected to your database now!");
Toast.makeText(CategoryDisplayActivity.this, "DB
Connected!",
Toast.LENGTH_SHORT).show();
} else {
System.out.println("Failed to make connection!");
}
} catch (ClassNotFoundException e) {
System.out.println("Where is your Oracle JDBC Driver?");
e.printStackTrace();
return;
} catch (SQLException e) {
System.out.println("Connection Failed! Check output console");
e.printStackTrace();
return;
}
--
Cheers,
INDU........
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en