Question: I am having problem retrieving OUT parameter from mysql stored procedure in java.

```
CALL proc_after_topic_add('newtest',@result);
SELECT @result;

```

this query gives me desired out parameter but how would i retrieve it in java.I tried using CallableStatement but i get 

```
java.sql.SQLException: Callable statments not supported.

```

error.Please guys help me.
I have tried following

```
String sql = "CALL proc_after_topic_add(?,?);";
            CallableStatement cstmt = conn.prepareCall(sql);
            cstmt.setString(1, topicname);
            cstmt.registerOutParameter(2, java.sql.Types.INTEGER);
            ResultSet rs = cstmt.executeQuery();
            if (rs.next()) {
                if (rs.getInt(1) == 1) {
                    res = 0;
                } else {
                    res = -1;
                }
            }

```

I havent posted stored procedure code because there is nothing wrong with it.

```
PS:I a using mysql 5.5.21 and yes i should probably mention i am using mysql connector 3.0.15

```

**Okay this is solved.For anyone who encounters the same problem,just download latest version of mysql connector.**

Answer: 
The only way that you can use the Win32 API to do this is if the item whose text you want to grab is a Win32 control, backed by an actual window.

That's why it works fine if the other item is a textbox or a label, because those are both implemented using Win32 `EDIT` and `STATIC` controls, respectively.

I don't know exactly what you mean by a "panel", but my guess is that it has been custom drawn by the other application. You'll therefore need to ask that application for the text it contains. Windows cannot give it to you because it is not a standard Windows control. If you cannot ask the other application, for whatever reason, you will need to research [alternative methods, like UI automation](https://stackoverflow.com/questions/4665045/how-to-get-the-word-under-the-cursor-in-windows). 

If by "panel", you mean a [group box](http://msdn.microsoft.com/en-us/library/windows/desktop/bb775947.aspx), well then that is just a standard Windows button control and it has a caption (displayed at the top). You can retrieve that in the same way you'd retrieve the caption of a label control. In Win32 terms, that means sending a [`WM_GETTEXT` message](http://msdn.microsoft.com/en-us/library/windows/desktop/ms632627.aspx) to the control.
Here is a solution that i used:
 Tesseract an open source OCR engine and here the link to get it : <https://code.google.com/p/tesseract-ocr/>

how to use it :

```
Imports System.IO
Imports System.Threading
Imports System.Collections.Specialized

Public class myClass

Private ProcessList As New Hashtable

Private Sub Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)     Handles Button.Click
Dim croppedFile as String = "C:\image.tif"
Dim OCRProcess As Process = New Process()
OCRProcess.StartInfo.FileName = "C:\tesseract\tesseract.exe"
OCRProcess.StartInfo.Arguments = croppedFile & " " & croppedFile & " -l eng"
OCRProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
OCRProcess.StartInfo.CreateNoWindow = True
OCRProcess.EnableRaisingEvents = True
AddHandler OCRProcess.Exited, AddressOf Me.ProcessExited
OCRProcess.Start()
ProcessList.Add(OCRProcess.Id.ToString, croppedFile & ".txt")
Do While Not OCRProcess.HasExited
    Application.DoEvents()
Loop
End Sub

Friend Sub ProcessExited(ByVal sender As Object, ByVal e As System.EventArgs)
Dim Proc As DictionaryEntry
Dim oRead As StreamReader
Dim EntireFile As String = ""
For Each Proc In ProcessList
    If (sender.id.ToString = Proc.Key) Then
        oRead = File.OpenText(Proc.Value)
        EntireFile = oRead.ReadToEnd()
    End If
Next
MsgBox(EntireFile)
End Sub

End Class

```

Hope it will help someone