Note that there are some explanatory texts on larger screens.

plurals
  1. POMaking Oracle DB connection Dynnamically in JSP
    primarykey
    data
    text
    <p>Connecting to database dynamically jsp</p> <p>Hi, I'm trying to make connection to database dynamically. So when user clicks link from index page, it will send parameter "OS" so my test page will receive parameter OS, looks for matchs in textfile that has list of database information like</p> <pre><code>XP-jdbc:oracle:thin@xx.xxx.xx.xx:xxxx:XPXP1-XP_user-XP_pass W7-jdbc:oracle:thin@YY.YYY.YY.YY:YYYY:W7W71-W7_user-W7_pass MAC-jdbc:oracle:thin@ZZ.ZZZ.ZZ.ZZ:ZZZZ:MACO1-MAC_user-MAC_pass LINNUX-jdbc:oracle:thin@AA.AAA.A.AA:AAAA:LINN1-LINNUX_user-LINNUX_ph1 </code></pre> <p>my attempt:</p> <pre><code>String userName = request.getParameter("OS"); try{ String db = ""; String[] temp1; String dblist = root + "\\" + "dblist.txt"; BufferedReader dbin = new BufferedReader(new FileReader(dblist)); while ((db = dbin.readLine()) != null){ temp1=db.split("-"); if ((temp1[0].equals(userName))){ connString = temp1[1].toString(); connUser = temp1[2].toString(); connPass = temp1[3].toString(); } } dbin.close(); }catch (IOException ex) { System.out.println(ex); } try{ DriverManager.registerDriver(new oracle.jdbc.OracleDriver()); Connection conn = DriverManager.getConnection(connString, connUser, connPass); Statement stmt = conn.createStatement(); } </code></pre> <p>My problem is, this doesn't work! I get java.sql.SQLException: Invalid Oracle URL specified when i open my web page.... What did i have wrong?</p> <p>Apparently my property file was corrutped >.> that was the reason why my property file only read half of it's components...thanks for your help anyways</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload