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 7642393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:10:43+00:00 2026-05-31T09:10:43+00:00

I have connected my two laptops using a cat5 cross ethernet cable. Both have

  • 0

I have connected my two laptops using a cat5 cross ethernet cable. Both have linux ubuntu installed.

Lappi 1: $ ifconfig eth0 192.168.1.16 up
Lappi 2: $ ifconfig eth0 192.168.1.17 up

both connected via wired ethernet connection

ping lappi 1: $ ping 192.168.1.17
give bytes means working

ping lappi 2: $ ping 192.168.1.16
working

lappi 1 has oracle xe 10g installed on it.

I want to fetch some rows using lappi-2 from oracle database at lappi-1.

Here is code

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class servertest 
{
    public void test() throws ClassNotFoundException, SQLException
    {
        Class.forName ("oracle.jdbc.driver.OracleDriver");
        Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@192.168.1.16:1521:XE","scott","tiger");
        Statement stmt = conn.createStatement();
        String query = "select  email_to from createemail";
        ResultSet rset = stmt.executeQuery(query);  

        while(rset.next())
        {
            System.out.println(rset.getString(0));  
        }
    }

    public static void main(String args[]) throws ClassNotFoundException, SQLException
    {
        servertest obj = new servertest();
        obj.test();
    }
}

It doesn’t give me any error. but it also doesn’t retrieve any rows. Sometimes I get an error “connection could not be established”…(occasionally) ]

  • 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-05-31T09:10:44+00:00Added an answer on May 31, 2026 at 9:10 am

    I don’t see any problem in the code. Maybe it does not return rows because there are not any. And it probably returns connection error, because the link is really down (maybe the cable is damaged…).

    Java has very good error reporting, just read the message carefully. If it reports it cannot connect, be 99% sure that it is the network problem. If there are no rows, double check that you are selecting the right table etc.

    Please follow Java Naming Conventions: class names start with uppercase.

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

Sidebar

Related Questions

I have two different-sized monitors, connected together using (I believe) TwinView. I tried System.out.println(Toolkit.getDefaultToolkit().getScreenSize());
Using two barcode readers connected to one machine, I have a need to store
I have two tables User and UserRole which are they connected using a link
I have two computers, both are connected to the internet. I'd like transfer some
I have connected both database, but used two connection string. Is there any possible
I have two keyboards connected to my PC, is there any way to know
Say I have two classes: Supplier, and Account. These classes are connected via has_one
I have a simple scenario, where two servers are connected through a gigabit link.
Imagine a situation, I have PC with two lan cards, one is connected to
I have two dates in format(MM/dd/yyyy hh:mm:ss:SS). For the both dates I have converted

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.