How to connect oracle database using android 


import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class AndroidoracleActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        TextView tv = new TextView(this);
    tv.setText("orcale Connect Example.");
    setContentView(tv);
    
    try {
     
Class.forName("oracle.jdbc.driver.OracleDriver");
 
} catch (ClassNotFoundException e) {
 
tv.setText("Where is your Oracle JDBC Driver?");
e.printStackTrace();
return;
    }
    tv.setText("Oracle database driver register");
    Connection conn =null ;
    
     try {
     conn 
=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe", 
"Parthiban",
"Parthiban");
    
    }
     catch(SQLException e){
     tv.setText("oracle driver is not installed check console");
     
     e.printStackTrace();
     return ;
     
     }
     if(conn !=null){
     tv.setText("oracle database registered u masde it to control");
     
     }
     else {
     tv.setText("failed to connection");
     }
     
    }
    }
        
    
i  did this code but it showing no driver wt i want todo...help me

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to