Zum Inhalt springen

Cyrill

Mitglieder
  • Gesamte Inhalte

    72
  • Benutzer seit

  • Letzter Besuch

Beiträge von Cyrill

  1. Hi

    Ich hab ein Problem mit dem einfügen eines Wertes in eine Datenbank (In ein Feld mit dem Typ Clob)!

    Mein Code sieht so aus:

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Zitat:</font><HR>

    try

    {

    Connection con = null;

    Statement stmt = null;

    ResultSet rs = null;

    con = pool.getConnection();

    if (DEBUG) System.out.println("con :" + con);

    stmt = con.createStatement();

    if (DEBUG) System.out.println("stmt :" + stmt);

    //Initialisierung des Clobs

    CLOB clob = null;

    stmt.execute("SELECT text from helptext");

    rs = stmt.getResultSet();

    while (rs.next())

    {

    clob = ((OracleResultSet)rs).getCLOB("text");

    }

    //ERROR (ORA-22920) == The row containing the LOB value must be locked before updating the LOB value

    OracleCallableStatement cstmt = (OracleCallableStatement) con.prepareCall ("BEGIN DBMS_LOB.OPEN(" +

    " ?, DBMS_LOB.LOB_READWRITE); END;");

    cstmt.setCLOB(1, clob);

    cstmt.execute();

    String s = this.text; // some Unicode character data

    java.io.Writer wr = clob.getCharacterOutputStream();

    //Write the input stream containing your ASCII data to the output stream. The write operation is finalized when you call the flush() method on the OutputStream object.

    char[] b = s.toCharArray(); // converts 's' to a character array

    wr.write(B);

    wr.flush();

    //Clean up:

    cstmt = (OracleCallableStatement) con.prepareCall ("BEGIN DBMS_LOB.CLOSE(?); END;");

    cstmt.setCLOB(1, clob);

    cstmt.execute();

    wr.close();

    stmt.close();

    con.close();

    }

    catch (SQLException sqle)

    {

    if (DEBUG) sqle.printStackTrace();

    System.err.println("SQL Exception :" + sqle);

    }

    catch (Exception e)

    {

    if (DEBUG) e.printStackTrace();

    System.err.println("Exception :" + e);

    }

  2. Hi

    Ja schon, aber sagen wir einmal unsere Hashtable sieht so aus:

    Key Wert

    1 TEST 1

    2 TEST 2

    3 TEST 3

    4 TEST 4

    5 TEST 5

    6 TEST 6

    Nun jetzt hab z.B den Wert TEST 5 und ich brauch den dazügehörigen Key... wie mache ich das! Umgekehrt ist es ja einfacher, da gehts mit "hashtable.get(key)"!

  3. Ja die Linuxfibel kann ich auch empfehlen.. ist sehr gut beschrieben dort!

    Um nur soviel anzeigen wie auf dem Bildschirm Platz halt musst du hinter deinem Kommando " | more " oder "| less "

    schreiben...

    Z.B

    less beispiel.txt | more

    less beispiel.txt | less

    Cyrill

    <FONT COLOR="#a62a2a" SIZE="1">[ 24. Oktober 2001 21:56: Beitrag 1 mal editiert, zuletzt von Cyrill ]</font>

  4. Hi

    Also ich benutze selbst BlackIce! Kann manchmal aufregen.. schützt aber so vor Nukes und so zeug was manchmal sehr praktisch sein kann! :)

    <A HREF="http://www.theparallax.com/forum/showthread.php?s=&threadid=203"" TARGET=_blank>Hier ne Kleine Diskussion über ein paar Windows Personal Firewalls bei THE PARALLAX</A>

    <FONT COLOR="#a62a2a" SIZE="1">[ 24. Oktober 2001 21:56: Beitrag 1 mal editiert, zuletzt von Cyrill ]</font>

  5. Hi

    Gibt es ne Möglichkeit mit Java die Prozesse in Win98 abzufragen!

    Und abzufragen wievile si von der CPU-Leistung benutzen und so weiteres! So wei beim "top" Befehl in Linux!

    Gruss Cyrill

    <FONT COLOR="#a62a2a" SIZE="1">[ 23. Oktober 2001 18:57: Beitrag 1 mal editiert, zuletzt von Cyrill ]</font>

  6. Gibt es den irgendeine Fehlermeldung??

    Bei if schleife muss da bei equals nicht noch was stehen!

    das ist doch ein Art Vergleich mit Strings oder? und dann braucht es doch 2 Angaben meines Wissens nach!

    if ( equals(currentCar.ps()) )
    
    {
    
    }
    
    System.out.println( currentCar.ps );

  7. Hi!

    Bei Blobs kannst du nur Binäre Dateien speichern. Falls du nur Charakters speichern willst - "String" Dann würde ich dir CLOB vorschlagen! Bei diesem Typ kann man auch bis zu 4 GBytes speichern.

  8. Hi

    Will ein Bild in eine Orcale DAtenbank speichern! Dieses Feld in dem das Bild gespeichert wird soll den Typ BLOB haben! Nun ich einiges gefunden jedoch gibt es bei mir immer diesen Fehler:

    Warning: Type created with compilation errors.

    Mein Import File sieht so aus:

    CREATE OR REPLACE TYPE ORDImage

    AS OBJECT (STATIC FUNCTION init(

    location

    srcType IN VARCHAR2,

    srcLocation IN VARCHAR2,

    srcName IN VARCHAR2) RETURN ORDImage);

    DECLARE

    myImage ORDSYS.ORDImage;

    BEGIN

    myImage := ORDSYS.ORDImage.init('BLOB','FILE','IMGDIR','/home/gis/czadra/www/bilder/cyrill.jpg');;

    INSERT INTO bild

    (idb, idh, bild, bildname, descr, comm) VALUES

    (bildkeygen.NextVal, '1', myImage, 'TEST BILD 1', 'TEST BILD 2', 'COMMENTS');

    COMMIT;

    END;

    /

    Hat irgend jemand ne Ahnung warum das nicht funktioniert!!

Fachinformatiker.de, 2024 by SE Internet Services

fidelogo_small.png

Schicke uns eine Nachricht!

Fachinformatiker.de ist die größte IT-Community
rund um Ausbildung, Job, Weiterbildung für IT-Fachkräfte.

Fachinformatiker.de App

Download on the App Store
Get it on Google Play

Kontakt

Hier werben?
Oder sende eine E-Mail an

Social media u. feeds

Jobboard für Fachinformatiker und IT-Fachkräfte

×
×
  • Neu erstellen...