sql connection

by engin » Sat, 22 Aug 2009 22:43:57 GMT


Sponsored Links
 Hi I wrote java code that connects remote sql server. But code does
not work in android. Code is as follows:
try {

        DriverManager.registerDriver(new
com.microsoft.sqlserver.jdbc.SQLServerDriver());
        String url="jdbc:sqlserver://hostname";
        Connection conn=DriverManager.getConnection
(url,"username","password");
        Statement stmt=conn.createStatement();
        DatabaseMetaData meta = conn.getMetaData();
        if (conn != null) {
                txt.setText("Conection Succesful");

        }
    }
        catch(SQLException se)
        {
                System.out.println("ERROR: " + se.getMessage());
        }


And log is follows:

08-22 17:32:40.777: ERROR/AndroidRuntime(17582):
java.lang.VerifyError:
com.microsoft.sqlserver.jdbc.SQLServerConnection
08-22 17:32:40.777: ERROR/AndroidRuntime(17582):     at
com.microsoft.sqlserver.jdbc.SQLServerDriver.connect
(SQLServerDriver.java:840)


--~--~---------~--~----~------------~-------~--~----~



sql connection

by Mark Murphy » Sat, 22 Aug 2009 22:51:34 GMT


 


Android does not include JDBC.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

_Android Programming Tutorials_ Version 1.0 In Print!

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


sql connection

by akitto » Tue, 25 Aug 2009 01:05:31 GMT


 Not 100% sure as i am away form my computer and out on my android
phone, but I thought it would be more likely to be that you did not
include the Microsoft sql jar for your deployed environment.?




--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. surfaceCreated() and CreateSurface() in camera preview application

I don't know all the answers to your question. Here's what I know.
1. If your application only needs to show the preview and does not
need to process the preview frame, the app doesn't need to allocate
any buffer or register preview callback. The framework/driver will
draw the preview for your app.
2. For G1 and Magic, preview buffers are allocated by the driver.
During start preview, camera service gets the preview heap from the
driver and calls registerBuffers on the surface. See
registerPreviewBuffers() in frameworks/base/camera/libcamera/
CameraService.cpp in 2.0 for reference. Whenever the camera service
gets a preview frame from the driver, it calls mSurface->postBuffer()
to draw on the surface. Droid uses overlay and the driver directly
draws on the screen.




-- 

2. Recording direct system audio??

Im trying to record audio directly from the system. Using the standard
API, you can only record from the MIC or phonecalls, ala:
MediaRecorder

Some ways I've tried is to read from /dev/audio and /dev/eac from my
app, but I think the sandbox of the app is preventing this.

Im thinking about using the NDK, but Im not sure if that would
overcome the sandbox aspect ?

Ideally, there is some solution outthere to access the audio sub-
system directly. Whether it be directly to alsa, to the AudioFlinger,
to /dev/eac

Anyone have ideas?

This file here:
http://www.google.com/codesearch/p?hl=en&sa=N&cd=11&ct=rc#-EqHK0vgjLY/src/com/mexuar/corraleta/audio/dev/RawDev.java&q=%22/dev/%22%20android%20file:.java

apparently accesses /dev/audio, but when I try, it says it doesnt
exist.

Any clues would help,thanks.

-- 

3. Low level audio really needed - too much latency in SoundPool, AudioTrack for more real time stuff

4. Problem with Timer and ImageView (with setImageResource)

5. Android 2.0 camera.setParameters(p) - Picture size must be 213x350?

6. Drawing a Camera Preview in a certain area of the screen

7. How to record the audio from mic in raw pcm format into a buffer, using the native libraries directly?