Forum Discussion

naveenshetty's avatar
naveenshetty
New Contributor
5 years ago

groovy blob read

hi,

 

Can you please help me here ,

In the oracle database one of the cloumn "Token" stored as BLOB I want to read this and update meta data and store back to database.

could you please help me on this?

 

So far I tried with 

 

import groovy.sql.Sql
import java.sql.*

sql = Sql.newInstance("jdbc:oracle:thin:@servername.muc:port:sid", "username", "pw")
//selct blob
java.sql.Blob blob = sql.firstRow("SELECT TOKEN FROM oauth_access_token").blob
byte[] bdata = blob.getBytes(1, (int) blob.length());
String text = new String(bdata);
log.info text;

 

saved this code as .groovy and ran it in my local machine , getting 

Caught: java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@localhost:1541:tb2vrdeu
java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@localhost:1541:tb2vrdeu
at script.run(script.groovy:4)

 

 

4 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    1. Make sure the oracle jdbc driver library under READYAPI_HOME/bin/ext directory. and restart the tool.
    2. Register driver. before using it, you can find online same.
  • sonya_m's avatar
    sonya_m
    SmartBear Alumni (Retired)

    richienmrao thank you for the great suggestions on this! 

     

    naveenshetty did the advice help you solve your issue?