Problem in answerMachine  pls help me

Hi All my problem is exactly when u detect dtmf char can not stop playying wav file the code is below
import java.net.*;
import javax.telephony.*;
import javax.telephony.events.*;
import javax.telephony.media.*;
import javax.telephony.media.events.*;
import java.io.*;
//class MachineCallObserver implements MediaCallObserver {
class MachineCallObserver implements CallObserver {
public void callChangedEvent(CallEv evlist[]) {
TerminalConnection tc = null;
MediaTerminalConnection mtc = null;
for (int i = 0; i < evlist.length; i++) {
CallEv ev = evlist;
if (ev instanceof TermConnCreatedEv) {
tc = ((TermConnEv)ev).getTerminalConnection();
mtc = (MediaTerminalConnection)tc;
String sExt = ".wav";
try {
mtc.usePlayURL(new URL("file:./greet" + sExt));
//mtc.useRecordURL(new URL("file:./Treeting" + sExt));
catch (Exception excp) {
System.out.println("(1)"+excp.toString());
else if (ev instanceof TermConnRingingEv) {
final TerminalConnection tcc = ((TermConnEv)ev).getTerminalConnection();
Terminal t = tcc.getTerminal();
Address a[] = t.getAddresses();
// For the callers name
//setTitle(t.getName()+"bilal");
// For the callers phone number
//lblMisc.setText(a[0].getName());
System.out.println(a[0].getName()+"bilal");
Runnable r = new Runnable() {
public void run() {
try{
tcc.answer();
catch (Exception excp){
// Handle answer exceptions
System.out.println( "hata2");
Thread T = new Thread(r);
T.start();
try {
tc.answer();
catch (Exception excp) {
System.out.println("(2)"+excp.toString());
else if (ev instanceof MediaTermConnAvailableEv) {
tc = ((TermConnEv)ev).getTerminalConnection();
mtc = (MediaTerminalConnection)tc;
try {
mtc.setDtmfDetection(true);
mtc.startPlaying();
if (ev instanceof MediaTermConnDtmfEv) mtc.stopPlaying();
catch (Exception excp) {
System.out.println("(3)"+excp.toString());
else if (ev instanceof MediaTermConnStateEv) {
tc = ((TermConnEv)ev).getTerminalConnection();
mtc = (MediaTerminalConnection)tc;
try {
int state = mtc.getMediaState();
//if ((state == 0) && (MediaTerminalConnection.PLAYING == 0)) {
//mtc.startRecording();
catch (Exception excp) {
System.out.println("(4)"+excp.toString());
else if (ev instanceof MediaTermConnUnavailableEv) {
tc = ((TermConnEv)ev).getTerminalConnection();
mtc = (MediaTerminalConnection)tc;
try {
mtc.stopRecording();
mtc.stopPlaying();
mtc.setDtmfDetection(false);
catch (Exception excp) {
System.out.println("(5)"+excp.toString());
else if (ev instanceof MediaTermConnDtmfEv) {
String sExt = ".wav";
tc = ((TermConnEv)ev).getTerminalConnection();
mtc = (MediaTerminalConnection)tc;
try {
mtc.stopPlaying();
catch (Exception excp) {
System.out.println("(6)"+excp.toString());
char digit = ((MediaTermConnDtmfEv)ev).getDtmfDigit();
System.out.println("detected DTMF: " + digit);
switch (digit) {
case '0':
try {
mtc.stopPlaying();
mtc.usePlayURL(new URL("file:./zero" + sExt));
mtc.startPlaying();
catch (Exception excp) {
System.out.println("(7)"+excp.toString());
break;
case '1':
try {
mtc.stopPlaying();
mtc.usePlayURL(new URL("file:./one" + sExt));
mtc.startPlaying();
catch (Exception excp) {
System.out.println("(8)"+excp.toString());
break;
case '2':
try {
mtc.stopPlaying();
mtc.usePlayURL(new URL("file:./two" + sExt));
mtc.startPlaying();
catch (Exception excp) {
System.out.println("(9)"+excp.toString());
break;
case '3':
try {
mtc.stopPlaying();
mtc.usePlayURL(new URL("file:./three" + sExt));
mtc.startPlaying();
catch (Exception excp) {
System.out.println("(10)"+excp.toString());
break;
default:
try {
mtc.stopPlaying();
mtc.usePlayURL(new URL("file:./greet" + sExt));
mtc.startPlaying();
catch (Exception excp) {
System.out.println("(11)"+excp.toString());
break;
please help me in this problem , if you u can pls help me

> Hi All my problem is exactly when u detect dtmf char
can not stop playying wav file the code is below
import java.net.*;
import javax.telephony.*;
import javax.telephony.events.*;
import javax.telephony.media.*;
import javax.telephony.media.events.*;
import java.io.*;
//class MachineCallObserver implements
MediaCallObserver {
class MachineCallObserver implements CallObserver {
public void callChangedEvent(CallEv evlist[]) {
TerminalConnection tc = null;
MediaTerminalConnection mtc = null;
for (int i = 0; i < evlist.length; i++) {
CallEv ev = evlist;
if (ev instanceof TermConnCreatedEv) {
tc =
tc = ((TermConnEv)ev).getTerminalConnection();
mtc = (MediaTerminalConnection)tc;
String sExt = ".wav";
try {
mtc.usePlayURL(new URL("file:./greet" +
./greet" + sExt));
//mtc.useRecordURL(new
ordURL(new URL("file:./Treeting" + sExt));
catch (Exception excp) {
System.out.println("(1)"+excp.toString());
else if (ev instanceof TermConnRingingEv) {
final TerminalConnection tcc =
on tcc = ((TermConnEv)ev).getTerminalConnection();
Terminal t = tcc.getTerminal();
Address a[] = t.getAddresses();
// For the callers name
//setTitle(t.getName()+"bilal");
// For the callers phone number
//lblMisc.setText(a[0].getName());
etName());
System.out.println(a[0].getName()+"bilal");
Runnable r = new Runnable() {
public void run() {
try{
tcc.answer();
catch (Exception excp){
// Handle answer exceptions
System.out.println( "hata2");
Thread T = new Thread(r);
T.start();
try {
tc.answer();
catch (Exception excp) {
System.out.println("(2)"+excp.toString());
else if (ev instanceof
anceof MediaTermConnAvailableEv) {
tc =
tc = ((TermConnEv)ev).getTerminalConnection();
mtc = (MediaTerminalConnection)tc;
try {
mtc.setDtmfDetection(true);
mtc.startPlaying();
if (ev instanceof MediaTermConnDtmfEv)
onnDtmfEv) mtc.stopPlaying();
catch (Exception excp) {
System.out.println("(3)"+excp.toString());
else if (ev instanceof MediaTermConnStateEv) {
tc =
tc = ((TermConnEv)ev).getTerminalConnection();
mtc = (MediaTerminalConnection)tc;
try {
int state = mtc.getMediaState();
//if ((state == 0) &&
e == 0) && (MediaTerminalConnection.PLAYING == 0)) {
//mtc.startRecording();
catch (Exception excp) {
System.out.println("(4)"+excp.toString());
else if (ev instanceof
anceof MediaTermConnUnavailableEv) {
tc =
tc = ((TermConnEv)ev).getTerminalConnection();
mtc = (MediaTerminalConnection)tc;
try {
mtc.stopRecording();
mtc.stopPlaying();
mtc.setDtmfDetection(false);
catch (Exception excp) {
System.out.println("(5)"+excp.toString());
else if (ev instanceof MediaTermConnDtmfEv) {
String sExt = ".wav";
tc =
tc = ((TermConnEv)ev).getTerminalConnection();
mtc = (MediaTerminalConnection)tc;
try {
mtc.stopPlaying();
catch (Exception excp) {
System.out.println("(6)"+excp.toString());
char digit =
digit = ((MediaTermConnDtmfEv)ev).getDtmfDigit();
System.out.println("detected DTMF: " +
TMF: " + digit);
switch (digit) {
case '0':
try {
mtc.stopPlaying();
mtc.usePlayURL(new URL("file:./zero" +
file:./zero" + sExt));
mtc.startPlaying();
catch (Exception excp) {
System.out.println("(7)"+excp.toString());
break;
case '1':
try {
mtc.stopPlaying();
mtc.usePlayURL(new URL("file:./one" +
"file:./one" + sExt));
mtc.startPlaying();
catch (Exception excp) {
System.out.println("(8)"+excp.toString());
break;
case '2':
try {
mtc.stopPlaying();
mtc.usePlayURL(new URL("file:./two" +
"file:./two" + sExt));
mtc.startPlaying();
catch (Exception excp) {
System.out.println("(9)"+excp.toString());
break;
case '3':
try {
mtc.stopPlaying();
mtc.usePlayURL(new URL("file:./three" +
ile:./three" + sExt));
mtc.startPlaying();
catch (Exception excp) {
System.out.println("(10)"+excp.toString());
break;
default:
try {
mtc.stopPlaying();
mtc.usePlayURL(new URL("file:./greet" +
ile:./greet" + sExt));
mtc.startPlaying();
catch (Exception excp) {
System.out.println("(11)"+excp.toString());
break;
please help me in this problem , if you u can pls
help me
hi my frinds this is code with out italic font

Similar Messages

  • Again same problem error 0xE8000003 pls help again i don't know it keep doing that

    Again same problem error 0xE8000003 pls help again i don't know it keep doing that please help with that

    Hello sartip fatah,
    The following article provides further information regarding this error, and steps to help resolve it.
    iOS: Unknown error containing '0xE' when connecting to a Windows PC
    http://support.apple.com/kb/TS3221
    Cheers,
    Allen

  • UnsatisfiedLinkError Problem.(Urgent)Pls Help!!

    Hi,
    I just want to run a swing under win98 OS platform and an error message appeared :
    Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\jdk1.4\jre\bin\awt.dll: An attempt was made to load a program with an incorrect format
    I have changed different version of JDK including 1.3.1 and 1.4beta, but the problem still exists.
    Is that any special setting need for running interface as I can run the java program in no trouble at all if there is no any interface.
    Another thing when i double click the java plug-in, there is an error message: "Could not found the main class. The Program would exit. ". How come?
    Pls Help and many thx.

    Post you code.

  • Problem with Eclipse  -- pls help

    hi
    When i execute the application in debug mode with one break point :
    These are the errors i get and the compiler is not stopping at the break point .
    Pls help :
    Thread [main] (Suspended (exception ClassNotFoundException))     
         ClassLoader.findBootstrapClass(String) line: not available [native method]     
         Launcher$ExtClassLoader(ClassLoader).findBootstrapClass0(String) line: not available     
         Launcher$ExtClassLoader(ClassLoader).loadClass(String, boolean) line: not available     
         Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line: not available     
         Launcher$AppClassLoader.loadClass(String, boolean) line: not available     
         Launcher$AppClassLoader(ClassLoader).loadClass(String) line: not available     
         Launcher$AppClassLoader(ClassLoader).loadClassInternal(String) line: not available

    If the compiler is not stopping at your breakpoint, then it probably means that the java code you're looking at and the compiled class file are out of synch. If you're getting a classnotfound, then your classfile most likely is either not there or is not where expected.
    Check the output folder in project's properties (which may or may not be the default), and see if your classfiles are actually there. Perhaps there is some error that is preventing your classfile from being generated (Eclipse sometimes won't even be able to compile), so check the problems dialog.
    Try refreshing your project, and if all else fails, restart Eclipse/delete & create the project again. That sometimes magically fixes things. Otherwise, welcome to the quirkiness of dealing with Eclipse!

  • NetBeans Problem with package, pls help.....

    Hi all, I have a package problem. With the following 2 classes, I can compile fine in dos with
    c:\java> javac WapDev3\*.java
    but wont compile in Netbeans 3.4 Pls help.
    The classes are
    -------------------class sample1 at c:\java\WapDev3------------------
    package WapDev3;
    class sample1 {
    public sample1() {
    System.out.println("hi");
    --------------------class sample2 at c:\WapDev3------------------
    package WapDev3;
    class sample2 {
    public sample2() {
    public static void main(String[] args) {
    sample1 osample1 = new sample1();

    I don't know for certain whether this is causing your problem, but in Netbeans, the package structure is considered to be identical to the directory structure, relative to the mountingpoint, so if your files are in java/wapdev, Netbeans wants you to make the package java/wapdev.
    This can be cured by mounting a subdirectory, using a relative mounting point.
    In your case, you should mount C:\java (I assume you've mounted C:\).
    Good luck.

  • Earpiece problem!! pls help!!

    my earpiece got a serious problem!!the left side is brust and is louder than the right side..PLs help!!can i hav it repair or do an xchange with apple !!! thks

    i'd like to ask if you played with the volume way up high for quite some time?...at first i tried testing the earphones to its limit...it did respond well...nothing happened...after that i limit the volume to a comfortable range...not after a friend tried it out and not to my knowing he pumped up the volume way up...after he returned it and when played to a 95 percent volume the right bud would give a distorted funny sound...but its still okay when played to a 80 percent range volume...and no, you cannot have a busted earphone fixed..(as far as what ive heard)its better to replace it with a new one...happy holidays!

  • Ipod Sounds Problem (Noise) OMG PLS HELP !!!

    Ok guys,
    I have a Ipod Classic 80G ...
    All the functions works fine, songs, sync, movies, pictures (yay) !
    But i week ago my ipod start to make a noise sound when i play my musics/movies !
    The noise sounds is similar when ur listening to a very bad quality song ...
    To understand the song i have to put the volume at MAX, but comes out really LOW and all noise and if i put the volume in LOW ... well cant hear nothing ... only noises !
    I cant say if im the responsable for that prob ... cuz its all started when my Ipod battery got at 0% ... so i was recharging the battery and my pc crashed and Ipod disconnected and after that THIS PROB started ><
    Firts i restored the Ipod ... lose all songs/movies/pictures =(
    But the problem still happening ...
    I tried squeezing the top right corner but no quality restored ...
    So wut should i do to fix this problem ? Someone pls enlight meh here !
    Should i take to Ipod's specialist ? or a Hammer will do the job ? Just Kidding xD
    Perhaps the Sound Board got screwed !?
    Thanks in Advance
    Jo

    I have this same problem! From what I have read so far it seems to be the headphone jack that is the issue. Apparently you can change these out but I don't know if I am brave enough to try it.
    I did have some luck with pulling the headphone plug out a bit. This seems to be a temporary fix but really in this case you are no longer connected and it is easy for the plug to fall out of the jack.
    Good luck to us both, I guess!!

  • Workflow problem...pls help

    Hi
    I have  requirement to deliver a single workitem to multiple agents. I am working on workflows for the first time and do not know how to send workitems and that too to multiple agents. Can anyone pls help.

    In classic workflow  tasks just set the AGENT to the list of people you wnat to send the work item to.
    Use the standard "Mail" type picture i (the envelope shape) in the Workflow builder for the forward work item steps.
    Be careful however that even if you do send a work item to multiple agents once one person has "reserved" the item it will disappear from all the other agents inboxes until the workitem has been completed.
    Cheers
    Jimbo

  • Simple calculation problem...pls help

    i have 2 report blocks in my report.
    the query for report block 1 is
    select emp_name,sal sal1 from emptable where emp_num=7167
    the query for the next report block is
    select emp_name,sal sal2 from emptable where emp_num=7168
    both the reports query the same table and get the same number of records.
    i want the difference of sal1-sal2...
    how do i do it..
    pls help....

    You could do salary diff calculation in a pl/sql function, and create the ref cursor query based on the function.
    Thanks,
    -Shaun

  • Connection problems over WIFI, Pls Help

    Hi, I'm currently have the new Macbook and I usually use my roommate's open network to connect to the internet via WIFI. All of a sudden I couldn't get through. The network shows that it is unlocked/unsecured but when I click to join, it leaves me hanging. The WIFI status icon on the status bar above shows full signal strenght but I can't get Safari to load any pages.
    Any suggestions, comments , help, pls?

        Hi jenjenjab19
    The problems you have described are very frustrating. I would be glad to look into this with you.
    Have you tried resetting your home Wifi? Please try a soft reset on the iPhone and retest. Here's how to reset the device: http://support.verizonwireless.com/clc/devices/knowledge_base.html?id=47670
    Please let me know if this helps.
    Thank you
    JoeL_VZW
    Please follow us on twitter @vzwsupport

  • I Can't Find The Problem!! pls help (ONLY IF U HAVE SOME FREE TIME)

    I'd like to post some code because I cant see the problem, maybe somebody else will see it. Just take a little look if u see some detail let me know pls.
    I have a class word, wich is actualy a representation of a word in some text
    public class Word {
    int timesInText; //how many times this word is in the text
    //A vector with the lines were the word appears
    public Vector<Integer> lines = new Vector<Integer>();
    public String word; //The word we are representing... Very creative Isn't it?
    //The lines were the word appear in a string in this format : , line, line, line...
    StringBuffer Stringlines = new StringBuffer(":");     
    public Palabra(String word) {
    this.word = word;          
    timesInText=1;
    public void wordFinded(int linea) {        
    lines.add(linea);     
    Stringlines.append(", " + linea);     
    timesInText++;     
    public String toString() {        
    String var = word + ": " + Stringlines.toString();
    return var;
    }//End of the word class
    I have a class main, wich is a window with the logic of the program, notice that
    I'll provide only the necesary thing to understand my problem in order to make
    my post shorter. The words I read can't have duplicates but I must say in wich
    lines the duplicates are.
    public class main{
    Vector<Word> words = new Vector<Word>(); //A vector for all the words in text
    JText area = new JTextArea(); //The JTextArea of my window
    public void getWords(){
    JFrame wordsInText = new JFrame("Word Search:");
    JTextArea wordsArea = new JTextArea("\tResult :");
    wordsInText.getContentPane().add(new JScrollPane(wordsArea));
    boolean alreadySeen;
    String text = area.getText();
    String line;
    String word;
    Word wordBeingRead;
    int lines = 0;
    BufferedReader br = new BufferedReader(new StringReader(text)); //To read complete text
    while ((line = br.readLine()) != null)
         lines += 1;
    StringTokenizer st = new StringTokenizer(line, " "); //But line by line
    while (st.hasMoreTokens())
    alreadySeen = false;
    word = st.nextToken();
    wordBeingRead = new Word(word);
    Iterator iter = words.iterator();
    if(!iter.hasNext()) //The first word! save it
    words.add(wordBeingRead);
    else //Yeah... not the first word... Check it...
    Iterator iterAux = palabras.iterator();
    while(iterAux.hasNext()) //Check if it's already defined
    Word p = (Word) iterAux.next();
    if(wordBeingRead.word.equals(p.word)) //It is already defined...
    wordBeingRead.wordFinded(lines); //I got one on line (lines)
    alreadySeen=true; //Yes! It's already seen
    if(alreadySeen==false) //If it's already seen wont get in here
    words.add(wordBeingRead); //A new word! Let's save it
    Iterator iter = palabras.iterator(); //Ok I saved all the words, time to print them
    while(iter.hasNext())
         wordBeingRead = (Word)iter.next();
         wordsArea.append("\n" + WordBeingRead.toString()); //Put them over here
         wordsInText.setSize(400, 400);
    wordsInText.setLocation(100, 75);
    wordsInText.setVisible(true); //Yes! show them
    }catch(Exception e){
    label.setText(e.getMessage()); //If anything goes wrong
    }//End of the class main

    Ok, sorry about that.
    Post your code between code tags (use the code button when you post a reply).I'm new in the forum and the tags doesnt seem to work with netscape, will use IE next time.
    you should not have a main class. You should have a main method inside a class eg:The original name of the class is Ventana, but you can actually name a class main.
    Also, your constructor should have the same name as your class eg:The constructor in the word class it's written like that because I translated the code to english so that it could be more simply to understand.
    4. If you don't get errors tell us what you expect your code to do and what it IS actually doing.Ok I'll give you a sample input and output:
    INPUT:
    "I am sorry for not posting correctly
    I will make sure this wont happen again
    I will be a good user"
    OUTPUT I'm getting:
    I: :
    am: :
    sorry: :
    for: :
    not: :
    posting: :
    correctly: :
    will: :
    make: :
    sure: :
    this: :
    wont: :
    happen: :
    again: :
    be: :
    a: :
    good: :
    user: :
    OUTPUT I would love to have:
    I: 1, 2, 3
    am: 1
    sorry: 1
    for: 1
    not: 1
    posting: 1
    correctly: 1
    will: 2, 3
    make: 2
    sure: 2
    this: 2
    wont: 2
    happen: 2
    again: 2
    be: 3
    a: 3
    good: 3
    user: 3
    I just noticed that I get the double : : Because I do it twice... ^^
    Thanks for the recomendations, and I'm sorry, totally my fault, I mean it.

  • Function problem...pls help??

    HELLO
    i have a fucntion
    FUNCTION GET_ABRV (PLAYERID NUMBER, MATCHID NUMBER)
    RETURN VARCHAR2 AS
    A VARCHAR2(100);
    BEGIN
         SELECT ' run out ('||table_col_1||' / '||table_col_2||')'
         INTO A
    FROM TABLE
    where PLAYER_ID = PLAYERID
    AND MATCH_ID = MATCHID;     
    RETURN (A);
    EXCEPTION WHEN NO_DATA_FOUND THEN RETURN NULL;
    END;
    This fucntion gives me the output in the following manner
    SQL> SELECT GET_ABRV(201, 10) FROM DUAL
    GET_DISMISSAL_9_DESCRIPTION(201,10)
    run out (S John / H Peal)
    that is ok!
    but the problem is that suppose if the value of the 'table_col_1' and 'table_col_2' is null either alone or
    combined in the table for any row then I want the output of the fucntion according to that
    suppose i call my fucntion
    SQL> SELECT GET_ABRV(321, 12) FROM DUAL
    now suppose the value of table_col_1 is null and the value of table_col_2 is not null the fucntion
    should give me the output like this...
    GET_DISMISSAL_9_DESCRIPTION(201,10)
    run out (A Smith)
    i.e. no slash before the name 'A Smith'
    at present it is giving me this output...
    GET_DISMISSAL_9_DESCRIPTION(201,10)
    run out ( / A Smith)
    but i want that if either value of the 'table_col_1' or 'table_col_2' is null then the fucntion should
    return me only the name (in brackets) and not any slash
    incase if both values 'table_col_1' and 'table_col_2' are null then the function should return me the
    value like this
    GET_DISMISSAL_9_DESCRIPTION(1011,20)
    run out
    i.e no brackets and the slash since table_col_1' and 'table_col_2' were null
    I want this to be done through the fucntion i pasted above...using only two input values that I have given in my fucntion i.e. (PLAYERID NUMBER, MATCHID NUMBER)
    hope this will clear my problem...
    regrds,
    Asim.

    SQL> create table runs(col_1 varchar2(10), col_2 varchar2(10)) ;
    Table created.
    SQL> insert into runs values (NULL, NULL) ;
    1 row created.
    SQL> insert into runs values (NULL, 'H Peal') ;
    1 row created.
    SQL> insert into runs values ('S John', 'H Peal') ;
    1 row created.
    SQL> insert into runs values ('S John', NULL) ;
    1 row created.
    SQL> CREATE OR REPLACE FUNCTION GET_ABRV (p_rowid ROWID)
      2  RETURN VARCHAR2 AS
      3    A VARCHAR2(100);
      4  BEGIN
      5    SELECT ' run out ('||
      6     LTRIM(RTRIM(col_1 || '/' || col_2, '/'), '/')||
      7     ')'
      8    INTO A
      9    FROM runs
    10    where ROWID = p_rowid;
    11    RETURN (A);
    12  EXCEPTION
    13  WHEN NO_DATA_FOUND
    14  THEN
    15    RETURN NULL;
    16  END;
    17  /
    Function created.
    SQL> show errors
    No errors.
    SQL> select REPLACE(get_abrv(rowid), '()') from runs ;
    REPLACE(GET_ABRV(ROWID),'()')
    run out
    run out (H Peal)
    run out (S John/H Peal)
    run out (S John)
    4 rows selected.
    SQL>

  • Internationalization problem...pls help

    hi,
    I have a Database that has chineese character.. my task is to read this characters from the database into a collection class (such as a array list, hash map or anything ).
    Then i need to check if the input chineese string is present in this set of characters read from the database....
    I dont know how to do it..
    What i am doing is storing them in an Arraylist and trying to use arrayList.contains() method to check if the character exists. But this fails. I think this does not work for UTF-8 characters. Any one has any suggestions?? pls help

    How do you treat String objects? Post a relevant portion of your code.

  • Oracle BLOB problem...pls help if possible

    I have been having trouble with my JSP code using the Tomcat server. I've finally gotten the compiler to recognize my result set as an Oracle Result set without it giving me casting errors. Here is part of my code:
    %@ page import="oracle.sql.*"%>
    <%@ page import="oracle.sql.BLOB"%>
    <%@ page import="oracle.jdbc.driver.*"%>
    <%@ page import="oracle.jdbc.driver.OracleResultSet"%>
    <%@ page import="java.lang.Object.*"%>
    <%@ page import="java.sql.*"%>
    <%@ page import="java.io.*"%>
    <body bgcolor="navajowhite">
    <%
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:Andy","system","pass");
    //con.setAutoCommit(false);
    Statement myStatement = null;
    String sourceDirectory = "D:\\Tomcat\\jakarta-tomcat-4.0.3\\webapps\\Root\\Mproject\\";
    String fileName = sourceDirectory + "Test.doc";
    String SS = "222-22-2222";
    myStatement.executeUpdate("INSERT INTO LI.TEST (ID, FILE_NAME, BLOB_COLUMN)" +
    "VALUES(SS,'" + fileName + "',EMPTY_BLOB())");
    oracle.jdbc.driver.OracleResultSet blobResultSet =
    (oracle.jdbc.driver.OracleResultSet)myStatement.executeQuery(
                   "select BLOB_COLUMN " +
                   "from LI.TEST "+
                   "where FILE_NAME = '" + fileName + "' " +
                   "FOR UPDATE" );
    blobResultSet.next();
    oracle.sql.BLOB myBlob;
    myBlob = ((oracle.jdbc.driver.OracleResultSet)blobResultSet).getBLOB("BLOB_COLUMN");
         int chunkSize = myBlob.getChunkSize();
         byte[] byteBuffer = new byte[chunkSize];
         File myFile = new File(fileName);
         FileInputStream myFileInputStream = new FileInputStream(myFile);
         long position = 1;
         int bytesRead;
         while ((bytesRead = myFileInputStream.read(byteBuffer)) != -1)
              myBlob.putBytes(position, byteBuffer);
              position += bytesRead;
         myFileInputStream.close();
    however now, it is still giving me wierd errors. It says that
    org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    D:\Tomcat\jakarta-tomcat-4.0.3\work\localhost\_\Mproject\blobtest5$jsp.java:0: The method oracle.jdbc2.Clob getClob(int) declared in interface oracle.jdbc.OracleResultSet cannot override the method of the same signature declared in interface java.sql.ResultSet. They must have the same return type.     
    package org.apache.jsp;
    ^
    D:\Tomcat\jakarta-tomcat-4.0.3\work\localhost\_\Mproject\blobtest5$jsp.java:0: The method oracle.jdbc2.Clob getClob(java.lang.String) declared in interface oracle.jdbc.OracleResultSet cannot override the method of the same signature declared in interface java.sql.ResultSet. They must have the same return type.     
    package org.apache.jsp;
    ^
    D:\Tomcat\jakarta-tomcat-4.0.3\work\localhost\_\Mproject\blobtest5$jsp.java:0: The method oracle.jdbc2.Ref getRef(int) declared in interface oracle.jdbc.OracleResultSet cannot override the method of the same signature declared in interface java.sql.ResultSet. They must have the same return type.     
    package org.apache.jsp;
    ^
    D:\Tomcat\jakarta-tomcat-4.0.3\work\localhost\_\Mproject\blobtest5$jsp.java:0: The method oracle.jdbc2.Ref getRef(java.lang.String) declared in interface oracle.jdbc.OracleResultSet cannot override the method of the same signature declared in interface java.sql.ResultSet. They must have the same return type.     
    package org.apache.jsp;
    ^
    D:\Tomcat\jakarta-tomcat-4.0.3\work\localhost\_\Mproject\blobtest5$jsp.java:0: The method oracle.jdbc2.Blob getBlob(int) declared in interface oracle.jdbc.OracleResultSet cannot override the method of the same signature declared in interface java.sql.ResultSet. They must have the same return type.     
    package org.apache.jsp;
    ^
    D:\Tomcat\jakarta-tomcat-4.0.3\work\localhost\_\Mproject\blobtest5$jsp.java:0: The method oracle.jdbc2.Blob getBlob(java.lang.String) declared in interface oracle.jdbc.OracleResultSet cannot override the method of the same signature declared in interface java.sql.ResultSet. They must have the same return type.     
    package org.apache.jsp;
    ^
    D:\Tomcat\jakarta-tomcat-4.0.3\work\localhost\_\Mproject\blobtest5$jsp.java:0: The method oracle.jdbc2.Array getArray(int) declared in interface oracle.jdbc.OracleResultSet cannot override the method of the same signature declared in interface java.sql.ResultSet. They must have the same return type.     
    package org.apache.jsp;
    ^
    D:\Tomcat\jakarta-tomcat-4.0.3\work\localhost\_\Mproject\blobtest5$jsp.java:0: The method oracle.jdbc2.Array getArray(java.lang.String) declared in interface oracle.jdbc.OracleResultSet cannot override the method of the same signature declared in interface java.sql.ResultSet. They must have the same return type.     
    package org.apache.jsp;
    ^
    8 errors, 1 warning
    can anybody tell me what i'm doing wrong? This is the last hurdle in my project and I would sincerly apprecaite any help. Many thanks
    Andrew

    OK, I'm confused. You declare a statement, set it to null, then try to execute a query with it? Your statement will still be null, you'll get a NullPointerException.
    And the OracleResultSet? This object will ONLY be created by using either Oracle's thin driver or OCI driver. The JDBC-ODBC bridge has no idea what an OracleResultSet is. The OracleResultSet IS a ResultSet object so there is no marked error on the cast, but the fit just isn't there. Had this compiled you could expect a ClassCastException at runtime.
    If you have to use ODBC, you will not be able to use Oracle-specific database objects. If you have an Oracle database available, then the ODBC driver is going to give you poor performance anyway, use Oracle's thin driver and you'll have access to the objects you're attempting to manipulate.
    And, as always, have fun!

  • MulticastSocket  problem!! pls help

    suppose a server listening to a port ( say 4444 ) wants to multicast a msg to a group of clients on internet.. then what should b d common group id( Class D ) and port number which all the clients have..

    Before you even start on this make sure your ISP and all the other intervening ISPs support multicast. They generally don't.
    You have to choose your own multicast group address either dynamically via MADCAP or statically.

Maybe you are looking for

  • How can I remove a device from the iCloud?

    I upgraded my iPad, replacing the old one, the new one does not sync with iCloud Drive, in other words my iPhone 6 used to sync data with the previous iPad. I have already checked the iCloud login and made sure iCloud drive is on on both devices and

  • Missing some basic functionality

    I seem to be missing some basic functionality, like switching to tty1-n using Ctrl+Alt+F1-n.  I can't begin to guess what this is related to, as after several installs I've never experienced that to be missing.  Can anyone point me in the right direc

  • JMS resource not located when starting Weblogic 8.1 as windows service

    I have a Weblogic 8.1 cluster which I am trying to configure as a Windows service.           The managed servers startup up without errors when started from the command line, but when I start it up as a service they do not seem to find the JMSConnect

  • Monitoring server connection

    Hello, i'm developing a client-server application with bluetooth and i must control the connection. So if the connection is down i want display a message. I'm using a while that send a special message to the server. My question is: there is another s

  • Unable to remove compilation tag

    I'm using iTunes 9 for Windows. Several CDs that I've imported into iTunes have been incorrectly tagged as Compilations. I've tried removing the "Part of a Compilation" tag both for: - individual tracks.....can't change the compilation tag. - all tra