Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

240
Visualizações
get values from another Java class

I want to get doktor[0], doktor[1], secilenBolum from RandevufiltreSorgu.java. I created object of RandevufiltreSorgu class in randevusec. But when I run the query, I am not able to obtain the values I want. There is no inheritance in use. What can I do?

public class randevusec {
    Connection conn = null;
    PreparedStatement ps = null;
    ResultSet rs = null;

    public ResultSet saatler() throws SQLException, Exception {
        randevufiltreSorgu nesne = new randevufiltreSorgu();
        try {
            Class.forName("org.postgresql.Driver");
            conn = DriverManager.getConnection("jdbc:postgresql://localhost:5432/tipmerkezivt", "postgres", "2569");
            ps = conn.prepareStatement(
                    "WITH Q1 AS(\n" + "    select * from doktor natural join bolum where dr_adi='" + nesne.doktor[0]
                            + "' and dr_soyadi='" + nesne.doktor[1] + "' and bolum.b_adi='" + nesne.secilenBolum + "'\n"
                            + "    )\n" + "    select cs_saat from doktorun_programi natural join Q1\n" + "    ",
                    ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
            rs = ps.executeQuery();
            return rs;
        } catch (Exception e) {
            throw new Exception("Bağlantı başarısız!");
        }

        finally {
            conn.close();
        }
    }
}
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

It is very hard to understand your code because it is mostly in foreign language, but what you can do is when you construct doktor[0] and doktor[1], put the keyword public static before them.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda