Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8942339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:29:28+00:00 2026-06-15T11:29:28+00:00

Connecting to database dynamically jsp Hi, I’m trying to make connection to database dynamically.

  • 0

Connecting to database dynamically jsp

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

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

my attempt:

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();

}

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?

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:29:29+00:00Added an answer on June 15, 2026 at 11:29 am

    you could use Class.forName(“sun.jdbc.odbc.JdbcOdbcDriver”); instead of DriverManager.registerDriver(new oracle.jdbc.OracleDriver());

    Also,have you checked if YY.YYY.YY.YY:YYYY is replaced by proper IP and port?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to retrieve information from my database.I got the input dynamically from user
I have an ASP.NET project connecting to a database. A web page sends a
We are trying to build an EntityConnection dynamically so that different users are connecting
I'm trying to export some data from MATLAB to a database. I use a
Is there a way to dynamically/programmatically set the connection string the EntLib 5 database
I am using azax to dynamically change the jsp page and I want to
I was creating connection string for sql express database dynamically.I wanted to know how
I am trying to insert into mysql database dynamically. But I always see only
How to create connection to database in VS2010 without SQL Client dynamically? I tried
I have followed his popular tutorial to connect Android to MySQL: http://www.helloandroid.com/tutorials/connecting-mysql-database It is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.