IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Spring Java Discussion :

java.sql.SQLException: Nom de colonne non valide, WHY? [Web Services]


Sujet :

Spring Java

  1. #1
    Membre averti
    Homme Profil pro
    Consultant informatique
    Inscrit en
    Février 2014
    Messages
    20
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Maroc

    Informations professionnelles :
    Activité : Consultant informatique
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Février 2014
    Messages : 20
    Par défaut java.sql.SQLException: Nom de colonne non valide, WHY?
    Bonjour,

    J'utilise hibernate 3 avec Spring 2.5, en essayant de lancer une requette sur une vue matérialisé je recois l'exeption ci-dessous.

    Merci de m'aider.

    Voici ma requette:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
     
    String sql =
    			"SELECT R.* FROM ADM_VALOTR.VIEW_RATEPLANS R WHERE CUSTOMER_ID IN ("
    				+ "select customer_id from adm_mv.mv_customer_all "
    				+ "connect by prior customer_id = customer_id_high and paymntresp is null "
    				+ "start with customer_id = ? and paymntresp = 'X')";
    		Collection<BscsContract> contracts =
    			this.jdbcTemplate.query( sql, new Object[] { new Long( customerID ) }, new RowMapper()
    			{
    				public Object mapRow( ResultSet rs, int rowNum )
    					throws SQLException
    				{
    					return getContract( rs );
     
    				}
    			} );
    l'execption remontée:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
     
    Caused by: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [SELECT R.* FROM ADM_VALOTR.VIEW_RATEPLANS R WHERE CUSTOMER_ID IN (select customer_id from adm_mv.mv_customer_all connect by prior customer_id = customer_id_high and paymntresp is null start with customer_id = ? and paymntresp = 'X')]; nested exception is java.sql.SQLException: Nom de colonne non valide
    at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:276)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:607)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:641)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:670)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:678)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:710)
    at com.orangecaraibe.vtr.dao.impl.BscsDaoImpl.getContractsOfPayer(BscsDaoImpl.java:523)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
    at $Proxy97.getContractsOfPayer(Unknown Source)
    at com.orangecaraibe.vtr.service.impl.ManageInstalledNetworkProductConsumptionImpl.findAndGet(ManageInstalledNetworkProductConsumptionImpl.java:149)
    at com.orangecaraibe.vtr.soa.provider.ManageInstalledNetworkProductConsumptionProvider.findAndGet(ManageInstalledNetworkProductConsumptionProvider.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:77)
    at com.orangecaraibe.enabler.Enabler.logMethod(Enabler.java:198)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616)
    at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:64)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:160)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy93.findAndGet(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
    at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
    ... 45 more
    Caused by: java.sql.SQLException: Nom de colonne non valide
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
    at oracle.jdbc.driver.OracleStatement.getColumnIndex(OracleStatement.java:3319)
    at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:1926)
    at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1515)
    at com.orangecaraibe.vtr.dao.impl.BscsDaoImpl.getContract(BscsDaoImpl.java:498)
    at com.orangecaraibe.vtr.dao.impl.BscsDaoImpl.access$200(BscsDaoImpl.java:38)
    at com.orangecaraibe.vtr.dao.impl.BscsDaoImpl$9.mapRow(BscsDaoImpl.java:529)
    at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:92)
    at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:653)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:591)

  2. #2
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    Nom de colonne non valide
    Ta requête SQL référence une colonne dans tes tables qui n'existe pas. Pour savoir laquelle, inspecte tes table et compare avec les colonnes référencées dans ta requête, car on ne peut pas, nous, deviner laquelle

  3. #3
    Membre averti
    Homme Profil pro
    Consultant informatique
    Inscrit en
    Février 2014
    Messages
    20
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Maroc

    Informations professionnelles :
    Activité : Consultant informatique
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Février 2014
    Messages : 20
    Par défaut
    En fait j'ai oublié de mentionner que en lançant la même requête dans sqldeveloper sur la même base j'obtiens un retour. Donc le soucis n'est pas avec la requête mais peut-être avec l'objet "BscsContract" que je n'arrive pas à identifier. Voici la structure de l'objet
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
     
    public class BscsContract
    {
    	long coId;
     
    	long customerId;
     
    	String msisdn;
     
    	BscsRateplan rateplan;
     
    	String offerSpecificationCode;
     
    	Collection<BscsService> services;
     
    	Collection<BscsConsumption> consumptions;
     
    	String status;
     
    	Date statusDate;
    Structure de la vue :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    CREATE OR REPLACE FORCE VIEW "ADM_VALOTR"."VIEW_RATEPLANS" ("CO_ID", "DN_NUM", "CUSTOMER_ID", "TMCODE", "TM_TYPE", "PRODUCT", "HT", "UNITE", "UNLIMITED_VOICE", "EURO", "VOLUME_EURO", "VOLUME_SECONDES", "UNLIMITED_DATA", "VOLUME_DATA", "UNITE_DATA", "VOLUME_SMS", "UNLIMITED_SMS_MMS") AS

  4. #4
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    Effectivement, j'avais mal lu la stack


    Je vois ceci dans l'erreur:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1515)
    at com.orangecaraibe.vtr.dao.impl.BscsDaoImpl.getContract(BscsDaoImpl.java:498)
    Donc à la ligne 498 de BscsDaoImpl.java, tu lit un nom de colonne qui n'existe pas dans la réponse SQL que tu as reçu. Vu que tu fais un "SELECT R.*", difficile à savoir quel nom ont les colonnes ("Machin", "R.Machin", ... ?). Il est préférable, selon moi, de lister explicitement les colonne que tu veux avec un identifiant clair pour que ton code le récupère

  5. #5
    Membre averti
    Homme Profil pro
    Consultant informatique
    Inscrit en
    Février 2014
    Messages
    20
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Maroc

    Informations professionnelles :
    Activité : Consultant informatique
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Février 2014
    Messages : 20
    Par défaut
    Possible cependant pourquoi en lancant la requête avec une seule colomn en retoure j'obtiens la même erreur:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
    SELECT R.CO_ID FROM ADM_VALOTR.VIEW_RATEPLANS R WHERE CUSTOMER_ID IN (select customer_id 
    from adm_mv.mv_customer_all connect by prior customer_id = customer_id_high and paymntresp 
    is null start with customer_id = ? and paymntresp = 'X')

  6. #6
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    les problèmes, c'est les appels à resultSet.getString(nomDeColonne), l'erreur dit que le nomDeColonne que tu demande en java n'est pas présent dans le résultat. Par exemple si j'exécute la requete


    Code sql : Sélectionner tout - Visualiser dans une fenêtre à part
    select id, name from Personnes

    et que j'appelle

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    String prenom = resultSet.getString("prenom");
    j'aurais l'erreur.

    Bref, ton erreur se situe sur

    com.orangecaraibe.vtr.dao.impl.BscsDaoImpl.getContract(BscsDaoImpl.java:498)

    où tu fait un getString qui n'est pas cohérent avec les colonnes que tu as demandées à Oracle dans la requête SQL. Et forcément, si tu refait un test en supprimant certaines colonne dans ton résultat SQL, ça ne va pas s'arranger

  7. #7
    Membre averti
    Homme Profil pro
    Consultant informatique
    Inscrit en
    Février 2014
    Messages
    20
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Maroc

    Informations professionnelles :
    Activité : Consultant informatique
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Février 2014
    Messages : 20
    Par défaut
    Tu as raison tchize, quand j'ai changé l'ordre de recupération du resultset dans getContract afin que ca soit au meme ordre des colomns dans la vue VIEW_RATEPLANS, j'obtiens une exception differente
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
     
    10:28:43,708 DEBUG org.springframework.jdbc.core.JdbcTemplate(574) - execute - Executing prepared SQL statement [SELECT * FROM ADM_VALOTR.VIEW_RATEPLANS WHERE CO_ID = ?]
    10:28:43,718 DEBUG org.springframework.jdbc.datasource.DataSourceUtils(112) - doGetConnection - Fetching JDBC Connection from DataSource
    10:28:43,858 DEBUG org.springframework.jdbc.core.StatementCreatorUtils(205) - setParameterValueInternal - Setting SQL statement parameter value: column index 1, parameter value [2200197], value class [java.lang.Long], SQL type unknown
    10:28:44,088 DEBUG org.springframework.jdbc.datasource.DataSourceUtils(312) - doReleaseConnection - Returning JDBC Connection to DataSource
    10:28:44,098 ERROR com.orangecaraibe.enabler.Enabler(204) - logMethod - Interceptor caught error: 
    java.lang.ClassCastException: java.util.ArrayList cannot be cast to com.orangecaraibe.vtr.dao.BscsContract
    	at com.orangecaraibe.vtr.dao.impl.BscsDaoImpl.getContract(BscsDaoImpl.java:290)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
    	at $Proxy163.getContract(Unknown Source)

  8. #8
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    java.lang.ClassCastException: java.util.ArrayList cannot be cast to com.orangecaraibe.vtr.dao.BscsContract
    	at com.orangecaraibe.vtr.dao.impl.BscsDaoImpl.getContract(BscsDaoImpl.java:290)
    Je crois que cette erreur est clair, t'as un arraylist, tu cast en BscsContract, ça peux pas marcher.

  9. #9
    Membre averti
    Homme Profil pro
    Consultant informatique
    Inscrit en
    Février 2014
    Messages
    20
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Maroc

    Informations professionnelles :
    Activité : Consultant informatique
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Février 2014
    Messages : 20
    Par défaut
    En effet je fait bien un cast du resultat de la requete à BscsContract, je ne vois pas d'autre solution pour récupérer le resultSet dans mon objet BscsContract

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
     
    Map<Long, BscsContract> result = new HashMap<Long, BscsContract>();
    		String sql = "SELECT * FROM ADM_VALOTR.VIEW_RATEPLANS WHERE CO_ID = ?";
     
    		BscsContract contract = null;
    		try
    		{
    			contract =
    				(BscsContract) this.jdbcTemplate.queryForObject( sql, new Object[] { new Long( coId ) },
    																	new RowMapper()
    																	{
    																		public Object mapRow( ResultSet rs, int rowNum )
    																			throws SQLException
    																		{
    																			return getContract( rs );
     
    																		}
    																	} );
    		}

  10. #10
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    Vu que le problème est dans la méthode getContract, ce serait bien qu'on aie le code de cette méthode

  11. #11
    Membre averti
    Homme Profil pro
    Consultant informatique
    Inscrit en
    Février 2014
    Messages
    20
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Maroc

    Informations professionnelles :
    Activité : Consultant informatique
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Février 2014
    Messages : 20
    Par défaut
    Ci-dessous le code de ma methode getContract():
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
     
    private BscsContract getContract( ResultSet rs )
    		throws SQLException
    	{
    		BscsContract contract = new BscsContract();
    		contract.setCoId( rs.getLong( "co_id" ) );
    		contract.setMsisdn( rs.getString( "dn_num" ) );
    		contract.setCustomerId( rs.getLong( "customer_id" ) );
     
    		BscsRateplan rateplan = new BscsRateplan();
     
    		rateplan.setTmCode( rs.getLong( "tmcode" ) );
    		rateplan.setType( rs.getString( "tm_type" ) );
    		if ( !"Y".equals( rs.getString( "ht" ) ) )
    			rateplan.setTva( true );
     
    		String unit = rs.getString( "unite" );
    		if ( "Money".equals( unit ) )
    			unit = "EURO";
    		else if ( "Seconds".equals( unit ) )
    			unit = "SECOND";
    		else if ( "Bytes".equals( unit ) )
    			unit = "BYTE";
     
    		// on identifie les forfaits principaux illimités - notamment les smartphone infini
    		if ( "Y".equals( rs.getString( "unlimited_voice" ) ) && rs.getLong( "volume_secondes" ) == 0 )
    			rateplan.setVoiceUnlimmited( true );
     
    		if ( "Y".equals( rs.getString( "euro" ) ) && !"DATA".equals( rs.getString( "product" ) ) )
    		{
    			rateplan.setVoiceBundleInitUnit( "EURO" );
    			rateplan.setVoiceBundleInitValue( rs.getDouble( "volume_euro" ) );
    			rateplan.setEquivalentInitValue( rs.getDouble( "volume_secondes" ) );
    			//rateplan.setEquivalentInitUnit( "SECOND" );
     
    			if ( "Y".equals( rs.getString( "unlimited_data" ) ) )
    			{
    				rateplan.setDataUnlimmited( true );
    			}
    			rateplan.setDataBundleInitValue( rs.getDouble( "volume_data" ) );
    			rateplan.setDataBundleInitUnit( "BYTE" );
    			rateplan.setUsage( "MONEY" );
    		}
    		else if ( "DATA".equals( rs.getString( "product" ) ) )
    		{
    			if ( "Y".equals( rs.getString( "euro" ) ) )
    			{
    				rateplan.setVoiceBundleInitUnit( "EURO" );
    				rateplan.setVoiceBundleInitValue( rs.getDouble( "volume_euro" ) );
    				if ( "BYTE".equals( unit ) || "Y".equals( rs.getString( "unlimited_data" ) ) )
    				{
    					rateplan.setEquivalentInitValue( rs.getDouble( "volume_data" ) );
    					rateplan.setEquivalentInitUnit( "BYTE" );
    				}
    				else
    				{
    					rateplan.setEquivalentInitValue( rs.getDouble( "volume_data" ) );
    					rateplan.setEquivalentInitUnit( "SECOND" );
    				}
    			}
    			else
    			{
    				rateplan.setDataBundleInitUnit( unit );
    				rateplan.setDataBundleInitValue( rs.getDouble( "volume_data" ) );
    				if ( "Y".equals( rs.getString( "unlimited_data" ) ) )
    				{
    					rateplan.setDataUnlimmited( true );
    					rateplan.setDataBundleInitUnit( "BYTE" );
    				}
    			}
    			rateplan.setUsage( "DATA" );
    		}
    		else
    		{
    			rateplan.setVoiceBundleInitUnit( "SECOND" );
    			rateplan.setVoiceBundleInitValue( rs.getDouble( "volume_secondes" ) );
    			rateplan.setUsage( "TIME" );
    		}
     
    		rateplan.setSmsBundleInitValue( rs.getDouble( "volume_sms" ) );
    		if ( "Y".equals( rs.getString( "unlimited_sms_mms" ) ) )
    		{
    			rateplan.setSmsUnlimmited( true );
    		}
     
    		rateplan.setSmsBundleInitValue( rs.getDouble( "volume_sms" ) );
    		if ( "Y".equals( rs.getString( "unlimited_sms_mms" ) ) )
    		{
    			rateplan.setSmsUnlimmited( true );
    		}
    		contract.setRateplan( rateplan );
    		return contract;

  12. #12
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    bizarre, je ne vois pas de casting.


    A quoi dans le code correspond cette ligne??

    com.orangecaraibe.vtr.dao.impl.BscsDaoImpl.getContract(BscsDaoImpl.java:290)

  13. #13
    Membre averti
    Homme Profil pro
    Consultant informatique
    Inscrit en
    Février 2014
    Messages
    20
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Maroc

    Informations professionnelles :
    Activité : Consultant informatique
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Février 2014
    Messages : 20
    Par défaut
    L'exception c'est ca
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    13:37:54,774 DEBUG org.springframework.jdbc.core.StatementCreatorUtils(205) - setParameterValueInternal - Setting SQL statement parameter value: column index 1, parameter value [2000197], value class [java.lang.Long], SQL type unknown
    13:37:54,928 DEBUG org.springframework.jdbc.datasource.DataSourceUtils(312) - doReleaseConnection - Returning JDBC Connection to DataSource
    #######################################################
    java.lang.ClassCastException: java.util.ArrayList cannot be cast to com.orangecaraibe.vtr.dao.BscsContract
    	at com.orangecaraibe.vtr.dao.impl.BscsDaoImpl.getContract(BscsDaoImpl.java:290)
    Ca correspond a { après le try (images ci-dessous de la ligne en question)
    Nom : 2014-02-27_134107.png
Affichages : 10876
Taille : 15,6 Ko

  14. #14
    Membre averti
    Homme Profil pro
    Consultant informatique
    Inscrit en
    Février 2014
    Messages
    20
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Maroc

    Informations professionnelles :
    Activité : Consultant informatique
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Février 2014
    Messages : 20
    Par défaut
    Tchize you the boss, merci beaucoup problème resolut.

    Le problème avec le nom de colomn etait en effet dût à l'ordre des resultsets récupérés dans la méthode getContract et le soucis avec cast etait dût à une déclaration de variable qui était de type Long au de long dans l'objet BscsContract.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 3
    Dernier message: 21/07/2013, 10h06
  2. Réponses: 1
    Dernier message: 21/01/2011, 15h17
  3. Réponses: 5
    Dernier message: 02/12/2010, 16h04
  4. Trigger INSERT : nom de colonne non valide
    Par arthuro45 dans le forum Développement
    Réponses: 6
    Dernier message: 13/09/2010, 21h58
  5. [SSIS] [2K5] : Nom de colonne non valide
    Par Adorien dans le forum SSIS
    Réponses: 0
    Dernier message: 13/05/2008, 16h37

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo