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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T23:32:40+00:00 2026-05-28T23:32:40+00:00

I have a java code that use a stored procedure for that it is:

  • 0

I have a java code that use a stored procedure for that it is:

ALTER PROCEDURE [dbo].[Search_Rent]
AS
BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    select * from SearchRent    
END

and SearchRent is a view in sql server

SELECT     dbo.Tbl_Software.ID AS SotwareID, dbo.Tbl_Software.UserID_Rent, dbo.Tbl_Software.Name AS SoftwareName, dbo.Tbl_User.Family, 
                      dbo.Tbl_User.Name AS UserName, dbo.Tbl_User.Tel, dbo.Tbl_Software.DataStart, dbo.Tbl_Software.DataFinish, dbo.Tbl_Software.ID_Category
FROM         dbo.Tbl_Software INNER JOIN
                      dbo.Tbl_User ON dbo.Tbl_Software.UserID_Rent = dbo.Tbl_User.ID

and my java code is:

public class frmRented extends javax.swing.JFrame {

    /** Creates new form frmRented */
    public frmRented() {
        initComponents();
        MyTools.SetCenterLocation(this);
        DataAccess da = new DataAccess();
        try {
            da.Connect();

            //da.rs = da.st.executeQuery("select * from SearchRent");
            //da.rs = da.st.executeQuery("{call Search_Rent()}");
            CallableStatement cal = da.con.prepareCall("{call Search_Rent()}",ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
            da.rs = cal.executeQuery();

            da.rs.last();
            int rc = da.rs.getRow();
            da.rs.beforeFirst();
            int cc = 9;

            String[] header = {"id", "idc", "name", "preamble", "k ", "s", "d", "a","e"};
            String[][] data = new String[rc][cc];
            int i = 0;

            while (da.rs.next()) {
                data[i][0] = da.rs.getString("Tbl_Software.ID");
                data[i][1] = da.rs.getString("Tbl_Software.ID_Category");
                data[i][2] = da.rs.getString("Tbl_Software.Name");
                data[i][3] = da.rs.getString("Tbl_Software.UserID_Rent");
                data[i][4] = da.rs.getString("Tbl_User.Name");
                data[i][5] = da.rs.getString("Tbl_User.Family");
                data[i][6] = da.rs.getString("Tbl_User.Tel");
                data[i][7] = da.rs.getString("Tbl_Software.DataStart");
                data[i][8] = da.rs.getString("Tbl_Software.DataFinish");
                i++;

            }
            jTable1 = new JTable(data, header);
            jScrollPane1.setViewportView(jTable1);
            cal.close();
            da.Disconnect();
        } catch (Exception e) {
            System.out.println(e);
        }

    }

but when I execute this code I have this error:

com.microsoft.sqlserver.jdbc.SQLServerException: The column name Tbl_Sofware.ID is not valid.

How can I solve this error?

  • 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-28T23:32:41+00:00Added an answer on May 28, 2026 at 11:32 pm

    Your view is not properly declared. Try to run SELECT statement from view in sole manner, and when you succeed, wrap the resulting statement with view.

    OR

    you need not specify the table alias while reading values thru reader, replace your code with this in appropriate manner AND you have to refer real column names from your view:

    data[i][0] = da.rs.getString("SotwareID");
    data[i][1] = da.rs.getString("ID_Category");
    data[i][2] = da.rs.getString("SoftwareName");
    data[i][3] = da.rs.getString("UserID_Rent");
    data[i][4] = da.rs.getString("UserName");
    data[i][5] = da.rs.getString("Family");
    data[i][6] = da.rs.getString("Tel");
    data[i][7] = da.rs.getString("DataStart");
    data[i][8] = da.rs.getString("DataFinish");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some Java code that uses curly braces in two ways // Curly
I have some Java code that is throwing out of memory exceptions after running
I have some Java code that connects to an Oracle database using DriverManager.getConnection(). It
I have a java script code that works fine when run through a browser,
I have existing java code and need to create Design Document based on that.
I have a standalone Java app that has some licensing code that I want
Here is the piece of code that I have used for Java 5.0 TreeSet<Integer>
In my Java code I have function that gets file from the client in
I have a method that contains the following (Java) code: doSomeThings(); doSomeOtherThings(); doSomeThings() creates
I recently have a problem that my java code works perfectly ok on my

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.